이 페이지에서

vector4d QML Value Type

vector4d 유형에는 x, y, z 및 w 속성이 있습니다. 더 보기...

Import Statement: import QtQuick

상세 설명

vector4d 유형은 x, y, z 및 w 속성을 가지며, 그 외에는 vector3d 유형과 유사합니다.

vector4d 유형의 속성은 기본적으로 0 벡터를 가집니다. 이때 x, y,z 및 w 속성은 0 로 설정되어 있습니다.

자세한 내용은 vector3d 유형에 대한 문서를 참조하십시오.

vector4d 값을 생성하려면 "x,y,z,w" 문자열로 지정하거나, 각 구성 요소를 개별적으로 정의하거나, Qt.vector4d() 함수를 사용하여 구성하십시오.

vector4d 유형에는 QML에서 호출할 수 있는 다음과 같은 항등 함수가 있습니다:

함수 시그니처설명예
real dotProduct(vector4d other)this 벡터4d와 other 벡터4d의 내적 결과를 실수형 스칼라 값으로 반환합니다.
var a = Qt.vector4d(1,2,3,4);
var b = Qt.vector4d(5,6,7,8);
var c = a.dotProduct(b);
console.log(c); // 70
vector4d times(matrix4x4 matrix)this 인 vector4d를 4x4 matrix 로 변환한 결과인 vector4d를 반환합니다. 이 변환은 벡터 후 행렬 적용 방식으로 수행됩니다.
var a = Qt.vector4d(1,2,3,4);
var b = Qt.matrix4x4(4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19);
var c = a.times(b);
console.log(c.toString()); // QVector4D(120, 130, 140, 150)
vector4d times(vector4d other)this 인 vector4d에 other 인 vector4d를 곱한 결과인 vector4d를 반환합니다.
var a = Qt.vector4d(1,2,3,4);
var b = Qt.vector4d(5,6,7,8);
var c = a.times(b);
console.log(c.toString()); // QVector4D(5, 12, 21, 32)
vector4d times(real factor)this 인 vector4d와 스칼라를 곱한 결과인 vector4d를 반환합니다. factor
var a = Qt.vector4d(1,2,3,4);
var b = 4.48;
var c = a.times(b);
console.log(c.toString()); // QVector3D(4.48, 8.96,
                                        13.44, 17.92)
vector4d plus(vector4d other)this vector4d와 other vector4d를 더한 결과인 vector4d를 반환합니다.
var a = Qt.vector4d(1,2,3,4);
var b = Qt.vector4d(5,6,7,8);
var c = a.plus(b);
console.log(c.toString()); // QVector4D(6, 8, 10, 12)
vector4d minus(vector4d other)other 인 vector4d에서 this 인 vector4d를 뺀 결과를 vector4d로 반환합니다.
var a = Qt.vector4d(1,2,3,4);
var b = Qt.vector4d(5,6,7,8);
var c = a.minus(b);
console.log(c.toString()); // QVector4D(-4, -4, -4, -4)
vector4d normalized()this 벡터의 정규화된 형태를 반환합니다.
var a = Qt.vector4d(1,2,3,4);
var b = a.normalized();
console.log(b.toString());
// QVector4D(0.182574, 0.365148, 0.547723, 0.730297)
real length()this 벡터3d의 길이에 해당하는 스칼라 실수 값을 반환합니다.
var a = Qt.vector4d(1,2,3,4);
var b = a.length();
console.log(b.toString()); // 5.477225575051661
vector2d toVector2d()this vector4d를 vector2d로 변환한 결과인 vector2d를 반환합니다.
var a = Qt.vector4d(1,2,3,4);
var b = a.toVector2d();
console.log(b.toString()); // QVector2D(1, 2)
vector3d toVector3d()this vector4d를 vector3d로 변환한 결과를 반환합니다.
var a = Qt.vector4d(1,2,3,4);
var b = a.toVector3d();
console.log(b.toString()); // QVector3D(1, 2, 3)
bool fuzzyEquals(vector4d other, real epsilon)this 의 vector4d가 other 의 vector4d와 대략적으로 같을 경우 true를 반환합니다. this 의 각 속성이 other 의 epsilon 이내에 있을 경우 근사치가 true로 간주됩니다. epsilon 는 선택적 인자이며, 기본값 epsilon 은 0.00001입니다.
var a = Qt.vector4d(1,2,3,4);
var b = Qt.vector4d(1.0001, 1.9998, 2.0001, 3.9999);
var c = a.fuzzyEquals(b);        // default epsilon
var d = a.fuzzyEquals(b, 0.005); // supplied epsilon
console.log(c + " " + d); // false true

이 값 유형은 QtQuick 임포트를 통해 제공됩니다.

QML 값 유형도 참조하십시오 .

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.