This library was build for Quaternion & Dual Quaternion Calculation Tutorial.
Name | Type | Description |
---|---|---|
Create | std::array<double, 4> | Create Quaternion Rotation, Angle in Degree |
Conjugate | std::array<double, 4> | Quaternion Conjugate |
Normalize | double | Normalize Quaternion , Unit Quaternion = 1 |
Add | std::array<double, 4> | Add Two Quaternions |
Subtract | std::array<double, 4> | Subtract Two Quaternions |
Multiply | std::array<double, 4> | Multiply Two Quaternions |
MultiplyScalar | std::array<double, 4> | Multiply Quaternion with scalar value |
Name | Type | Description |
---|---|---|
Create | std::array<double, 8> | Create Dual Quaternion Rotation and Translation, Angle in Degree |
Rotation | std::array<double, 8> | Return Dual Quaternion Pure Rotation |
Translation | std::array<double, 4> | Return Vector Quaternion Translation |
Conjugate | std::array<double, 8> | Dual Quaternion Conjugate |
Add | std::array<double, 8> | Add Two Dual Quaternions |
Subtract | std::array<double, 8> | Subtract Two Dual Quaternions |
Multiply | std::array<double, 8> | Multiply Two Dual Quaternions |
Create a quaternion rotation based on the equation below :
Example :
double Angle = 90; //in Degrees
std::array<int, 3> DirectionOfRotation = {0,1,0};
std::array<double, 4> Quaternion1;
Quaternion1 = Quaternion::Create(Angle,DirectionOfRotation);
Return Quaternion Conjugate based on the equation below :
Example :
Quaternion::Conjugate(Quaternion1);
Return Quaternion Normalize based on the equation below :
Note : Normalize Unit Quaternion will return 1
Example :
Quaternion::Normalize(Quaternion1);
Add two Quaternions (P + Q) based on the equation below :
Example :
Quaternion::Add(Quaternion1,Quaternion2);
This library used std::array<>
Any improvment are appreciated