axis_angle_to_quatT_axis_angle_to_quatAxisAngleToQuatAxisAngleToQuataxis_angle_to_quat (Operator)

Name

axis_angle_to_quatT_axis_angle_to_quatAxisAngleToQuatAxisAngleToQuataxis_angle_to_quat — Create a rotation quaternion.

Signature

axis_angle_to_quat( : : AxisX, AxisY, AxisZ, Angle : Quaternion)

Herror T_axis_angle_to_quat(const Htuple AxisX, const Htuple AxisY, const Htuple AxisZ, const Htuple Angle, Htuple* Quaternion)

void AxisAngleToQuat(const HTuple& AxisX, const HTuple& AxisY, const HTuple& AxisZ, const HTuple& Angle, HTuple* Quaternion)

void HQuaternion::HQuaternion(const HTuple& AxisX, const HTuple& AxisY, const HTuple& AxisZ, const HTuple& Angle)

void HQuaternion::HQuaternion(double AxisX, double AxisY, double AxisZ, double Angle)

void HQuaternion::AxisAngleToQuat(const HTuple& AxisX, const HTuple& AxisY, const HTuple& AxisZ, const HTuple& Angle)

void HQuaternion::AxisAngleToQuat(double AxisX, double AxisY, double AxisZ, double Angle)

static void HOperatorSet.AxisAngleToQuat(HTuple axisX, HTuple axisY, HTuple axisZ, HTuple angle, out HTuple quaternion)

public HQuaternion(HTuple axisX, HTuple axisY, HTuple axisZ, HTuple angle)

public HQuaternion(double axisX, double axisY, double axisZ, double angle)

void HQuaternion.AxisAngleToQuat(HTuple axisX, HTuple axisY, HTuple axisZ, HTuple angle)

void HQuaternion.AxisAngleToQuat(double axisX, double axisY, double axisZ, double angle)

def axis_angle_to_quat(axis_x: Union[float, int], axis_y: Union[float, int], axis_z: Union[float, int], angle: Union[float, int]) -> Sequence[Union[float, int]]

Description

Quaternions are an extension of the complex numbers. The set of quaternions is given by . In HALCON, quaternions are represented by a tuple containing four elements: [x_{0},x_{1},x_{2},x_{3}].

Unit quaternions can be used to describe rotations. A quaternion is a unit quaternion if its norm is 1. A counterclockwise rotation around an unit vector v (AxisXAxisXAxisXAxisXaxisXaxis_x, AxisYAxisYAxisYAxisYaxisYaxis_y, AxisZAxisZAxisZAxisZaxisZaxis_z) by an angle a (AngleAngleAngleAngleangleangle) can be described by the unit quaternion q =(cos(a/2), sin(a/2) v).

The operator axis_angle_to_quataxis_angle_to_quatAxisAngleToQuatAxisAngleToQuatAxisAngleToQuataxis_angle_to_quat can be used to create such a quaternion. To rotate a point using QuaternionQuaternionQuaternionQuaternionquaternionquaternion use the operator quat_rotate_point_3dquat_rotate_point_3dQuatRotatePoint3dQuatRotatePoint3dQuatRotatePoint3dquat_rotate_point_3d.

Note that two rotations can be concatenated using the operator quat_composequat_composeQuatComposeQuatComposeQuatComposequat_compose. Further, you can use a rotation quaternion to set the orientation of the 3D plot in set_paintset_paintSetPaintSetPaintSetPaintset_paint.

Attention

The operator axis_angle_to_quataxis_angle_to_quatAxisAngleToQuatAxisAngleToQuatAxisAngleToQuataxis_angle_to_quat does not check whether the vector (AxisXAxisXAxisXAxisXaxisXaxis_x, AxisYAxisYAxisYAxisYaxisYaxis_y, AxisZAxisZAxisZAxisZaxisZaxis_z) is of unit length (i.e. of length 1). If this is not the case, QuaternionQuaternionQuaternionQuaternionquaternionquaternion will be no valid rotation quaternion.

Execution Information

Parameters

AxisXAxisXAxisXAxisXaxisXaxis_x (input_control)  real HTupleUnion[float, int]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

X component of the rotation axis.

AxisYAxisYAxisYAxisYaxisYaxis_y (input_control)  real HTupleUnion[float, int]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Y component of the rotation axis.

AxisZAxisZAxisZAxisZaxisZaxis_z (input_control)  real HTupleUnion[float, int]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Z component of the rotation axis.

AngleAngleAngleAngleangleangle (input_control)  real HTupleUnion[float, int]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Rotation angle in radians.

QuaternionQuaternionQuaternionQuaternionquaternionquaternion (output_control)  quaternion HQuaternion, HTupleSequence[Union[float, int]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Rotation quaternion.

Example (HDevelop)

** Normalize a vector and create a rotation quaternion
Length := sqrt(AxisX*AxisX+AxisY*AxisY+AxisZ*AxisZ)
AxisX := AxisX/Length
AxisY := AxisY/Length
AxisZ := AxisZ/Length
axis_angle_to_quat (AxisX, AxisY, AxisZ, rad(90), Quaternion)

Possible Successors

quat_to_hom_mat3dquat_to_hom_mat3dQuatToHomMat3dQuatToHomMat3dQuatToHomMat3dquat_to_hom_mat3d, quat_to_posequat_to_poseQuatToPoseQuatToPoseQuatToPosequat_to_pose, quat_rotate_point_3dquat_rotate_point_3dQuatRotatePoint3dQuatRotatePoint3dQuatRotatePoint3dquat_rotate_point_3d, quat_composequat_composeQuatComposeQuatComposeQuatComposequat_compose

See also

quat_normalizequat_normalizeQuatNormalizeQuatNormalizeQuatNormalizequat_normalize, quat_conjugatequat_conjugateQuatConjugateQuatConjugateQuatConjugatequat_conjugate, quat_interpolatequat_interpolateQuatInterpolateQuatInterpolateQuatInterpolatequat_interpolate, screw_to_dual_quatscrew_to_dual_quatScrewToDualQuatScrewToDualQuatScrewToDualQuatscrew_to_dual_quat

Module

Foundation