이 페이지에서

quaternion QML Value Type

쿼터니언 유형에는 스칼라, x, y, z 속성이 있습니다. 더 보기...

Import Statement: import QtQuick

상세 설명

quaternion 유형에는 scalar, x, y 및 z 속성이 있습니다.

quaternion 값을 생성하려면 "scalar,x,y,z" 형식의 문자열로 지정하거나, 각 성분을 개별적으로 정의하거나, Qt.quaternion() 함수를 사용하여 구성할 수 있습니다.

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

함수 시그니처설명예
real dotProduct(quaternion other)this 의 쿼터니언과 other 의 쿼터니언 간의 내적 결과를 실수형 스칼라 값으로 반환합니다.
var a = Qt.quaternion(1,2,3,4);
var b = Qt.quaternion(5,6,7,8);
var c = a.dotProduct(b);
console.log(c); // 70
쿼터니언 times(쿼터니언 other)this 쿼터니언과 other 쿼터니언을 곱한 결과인 쿼터니언을 반환하며, 이는 다음 두 회전을 모두 적용한 것과 같습니다.
var a = Qt.quaternion(1 / Math.sqrt(2), 1 / Math.sqrt(2), 0, 0);
var b = Qt.quaternion(1 / Math.sqrt(2), 0, 1 / Math.sqrt(2), 0);
var c = b.times(a);
console.log(c.toString()); // QQuaternion(0.5, 0.5, 0.5, -0.5)
vector3d times(vector3d vector)vector 를 this 쿼터니언으로 회전시킨 결과인 vector3d를 반환합니다.
var a = Qt.quaternion(0.5,0.5,0.5,-0.5);
var b = Qt.vector3d(4,5,6);
var c = a.times(b);
console.log(c.toString()); // QVector3D(5, -6, -4)
쿼터니언 times(실수 계수)this 쿼터니언에 스칼라를 곱한 쿼터니언 결과를 반환합니다. factor
var a = Qt.quaternion(1,2,3,4);
var b = 4.48;
var c = a.times(b);
console.log(c.toString()); // QQuaternion(4.48, 8.96, 13.44, 17.92)
쿼터니언 plus(쿼터니언 other)this 쿼터니언과 other 쿼터니언을 더한 쿼터니언 결과를 반환합니다.
var a = Qt.quaternion(1,2,3,4);
var b = Qt.quaternion(5,6,7,8);
var c = a.plus(b);
console.log(c.toString()); // QQuaternion(6, 8, 10, 12)
quaternion minus(quaternion other)other 쿼터니언에서 this 쿼터니언을 뺀 쿼터니언 결과를 반환합니다.
var a = Qt.quaternion(1,2,3,4);
var b = Qt.quaternion(5,6,7,8);
var c = a.minus(b);
console.log(c.toString()); // QQuaternion(-4, -4, -4, -4)
quaternion normalized()this 의 쿼터니언을 정규화된 단위 형태로 반환합니다
var a = Qt.quaternion(1,2,3,4);
var b = a.normalized();
console.log(b.toString()); // QQuaternion(0.182574, 0.365148, 0.547723, 0.730297)
quaternion inverted()this 의 쿼터니언의 역수를 반환합니다.
var a = Qt.quaternion(0.5,0.5,0.5,-0.5);
var b = a.inverted();
console.log(b.toString()); // QQuaternion(0.5, -0.5, -0.5, 0.5)
쿼터니언 복소공액()this 쿼터니언의 공액 값을 반환합니다
var a = Qt.quaternion(1,2,3,4);
var b = a.conjugated()
console.log(b.toString()); // QQuaternion(1, -2, -3, -4)
real length()this 쿼터니언의 길이에 해당하는 실수 스칼라 값을 반환합니다.
var a = Qt.quaternion(1,2,3,4);
var b = a.length();
console.log(b.toString()); // 5.477225575051661
vector3d toEulerAngles()this 쿼터니언에 해당하는 벡터3d 오일러 각(도 단위)을 반환합니다.
var a = Qt.quaternion(0.933012,0.25,-0.25,0.066987);
var b = a.toEulerAngles();
console.log(b.toString()); // QVector3D(30, -30, -4.28846e-05)
vector4d toVector4d()this 쿼터니언을 vector4d로 변환한 결과를 반환합니다.
var a = Qt.quaternion(1,2,3,4);
var b = a.toVector4d();
console.log(b.toString()); // QVector4D(2, 3, 4, 1)
bool fuzzyEquals(쿼터니언 other, 실수 epsilon)this 쿼터니언이 other 쿼터니언과 대략적으로 동일한 경우 true를 반환합니다. this 의 각 속성이 other 의 epsilon 이내에 있으면 근사치가 true로 간주됩니다. epsilon 은 선택적 인자이며, 기본값 epsilon 은 0.00001입니다.
var a = Qt.quaternion(1,2,3,4);
var b = Qt.quaternion(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

quaternion 유형의 속성은 Qt.quaternion(1, 0, 0, 0) 을 기본값으로 갖습니다.

이 값 유형은 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.