四元数(クォータニオン)の計算やらなんやらができます.主に演算子オーバーロードの練習で作りました.温かい目で見てやってください.
Dependencies: Vector3
Dependents: Hybrid_main_FirstEdtion MadgwickFilter MadgwickFilter
Fork of Quaternion by
Diff: Quaternion.hpp
- Revision:
- 4:a914c6c3b74d
- Parent:
- 3:19af2a12e73a
- Child:
- 5:3c531c1f56cc
diff -r 19af2a12e73a -r a914c6c3b74d Quaternion.hpp --- a/Quaternion.hpp Sat Jan 28 21:16:51 2017 +0000 +++ b/Quaternion.hpp Sat Jan 28 21:20:28 2017 +0000 @@ -121,7 +121,10 @@ }; }; -/** クォータニオンの掛け算をします.この際,順序が重要です.*/ +/** +* @fn Quaternion operator*(Quaternion l, Quaternion r) +* @bref クォータニオンの掛け算をします.この際,順序が重要です. +*/ Quaternion operator*(Quaternion l, Quaternion r){ static Quaternion Q; Q.w = l.w*r.w - l.x*r.x - l.y*r.y - l.z*r.z; @@ -136,7 +139,10 @@ return Q; }; -/** クォータニオンをスカラー倍します..*/ +/** +* @fn Quaternion operator*(double s, Quaternion q) +* @bref クォータニオンをスカラー倍します.. +*/ Quaternion operator*(double s, Quaternion q){ static Quaternion Q; Q.w = q.w * s; @@ -146,7 +152,10 @@ return Q; }; -/** クォータニオンをスカラー倍します..*/ +/** +* @fn Quaternion operator*(Quaternion q, double s) +* @bref クォータニオンをスカラー倍します.. +*/ Quaternion operator*(Quaternion q, double s){ static Quaternion Q; Q.w = q.w * s; @@ -156,7 +165,10 @@ return Q; }; -/** クォータニオンの足し算をします.*/ +/** +* @fn Quaternion operator+(Quaternion l, Quaternion r) +* @bref クォータニオンの足し算をします. +*/ Quaternion operator+(Quaternion l, Quaternion r){ static Quaternion Q; Q.w = l.w + r.w; @@ -166,7 +178,10 @@ return Q; } -/** クォータニオンの引き算をします.*/ +/** +* @fn Quaternion operator-(Quaternion l, Quaternion r) +* @bref クォータニオンの引き算をします. +*/ Quaternion operator-(Quaternion l, Quaternion r){ static Quaternion Q; Q.w = l.w - r.w;