GaitGeneration by Graph Search
|
クォータニオンを表す構造体. [詳解]
#include <math_quaternion.h>
公開メンバ関数 | |
constexpr | Quaternion () |
1 + {0,0,0}で初期化する, | |
constexpr | Quaternion (const float w_, const float x_, const float y_, const float z_) |
スカラー成分とベクトル成分を指定して初期化する. ノルムが1になるように代入すること, 使用は非推奨,MakeByAngleAxisを使うこと. | |
constexpr | Quaternion (const float w_, const Vector3 &v_) |
スカラー成分とベクトル成分を指定して初期化する. ノルムが1になるように代入すること, 使用は非推奨,MakeByAngleAxisを使うこと. | |
constexpr | Quaternion (const Quaternion &q)=default |
コピーコンストラクタ. | |
constexpr | Quaternion (Quaternion &&q) noexcept=default |
ムーブコンストラクタ. | |
constexpr Quaternion & | operator= (const Quaternion &q)=default |
コピー代入演算子. | |
constexpr Quaternion | operator+ () const noexcept |
constexpr Quaternion | operator- () const noexcept |
constexpr Quaternion | operator+ (const Quaternion &q) const noexcept |
constexpr Quaternion | operator- (const Quaternion &q) const noexcept |
constexpr Quaternion | operator* (const Quaternion &q) const noexcept |
constexpr Quaternion | operator* (const float s) const noexcept |
constexpr Quaternion | operator/ (const float s) const |
bool | operator== (const Quaternion &q) const noexcept |
bool | operator!= (const Quaternion &q) const noexcept |
bool | operator< (const Quaternion &q) const noexcept |
bool | operator> (const Quaternion &other) const noexcept |
bool | operator<= (const Quaternion &other) const noexcept |
bool | operator>= (const Quaternion &other) const noexcept |
constexpr float | Dot (Quaternion other) const noexcept |
クォータニオンの内積を返す. クォータニオンを4次元のベクトルとみなし,ベクトルの内積を求める. | |
constexpr Quaternion | GetConjugate () const noexcept |
クォータニオンの共役を返す. 共役なクォータニオンとは,ベクトル成分の符号を反転させたもの q = w + xi + yj + zk とすると, qの共役は w - xi - yj - zk となる.回転は逆方向になる | |
constexpr float | GetLengthSquared () const noexcept |
クォータニオンの長さの2乗を返す(ノルムの2乗). クォータニオンの長さの2乗は,w^2 + x^2 + y^2 + z^2 で求められる. | |
float | GetNorm () const noexcept |
クォータニオンのノルムを返す. ノルムとは,ベクトルの大きさのこと. クォータニオンのノルムは,w^2 + x^2 + y^2 + z^2 の平方根で求められる. | |
Quaternion | GetInverse () const |
クォータニオンの逆数を返す. クォータニオンqの逆数q^-1は,qの共役をノルムで割ったもの. q^-1 = q* / |q|^2 | |
Quaternion | GetNormalized () const noexcept |
正規化したクォータニオンを返す. クォータニオンの正規化とは,ノルムを1にすることを表す. クォータニオンqの正規化は,q / |q| で求められる. | |
constexpr float | GetDistanceSquared (const Quaternion &q) const noexcept |
他のクォータニオンとの距離の2乗を返す. クォータニオンを4次元ベクトルとみなし,ベクトルの距離の2乗を求める. | |
void | Normalize () noexcept |
自身を正規化する.ノルムが1になる. | |
constexpr Quaternion | ToLeftHandCoordinate () const noexcept |
左手座標系への変換を行う. 言うまでもないが,機械工学では通例右手座標系を使う. しかし,dxlib は左手座標系なので,dxlib で描画するときは, この関数を使って左手座標系に変換する必要がある. | |
std::string | ToString () const |
クォータニオンを文字列に変換する. w, x, y, z の順で出力する. | |
std::string | ToCsvString () const |
クォータニオンをCsv形式の文字列に変換する.カンマ区切り. w, x, y, z の順にカンマ区切りで出力する. | |
静的公開メンバ関数 | |
static Quaternion | MakeByAngleAxis (float rad_angle, const Vector3 &axis) |
回転軸と回転角からクォータニオンを作成する. q = cos(θ/2) * w + sin(θ/2) * { v.x + v.y + v.z } となる. ノルムは必ず1になる. | |
公開変数類 | |
float | w |
スカラー成分. | |
Vector3 | v |
ベクトル成分. | |
クォータニオンを表す構造体.
クォータニオンは,スカラー成分とベクトル成分からなる. 四元数とも呼ばれる.
math_quaternion.h の 37 行目に定義があります。
|
inlineconstexpr |
1 + {0,0,0}で初期化する,
math_quaternion.h の 40 行目に定義があります。
|
inlineconstexpr |
スカラー成分とベクトル成分を指定して初期化する. ノルムが1になるように代入すること,
使用は非推奨,MakeByAngleAxisを使うこと.
[in] | w_ | スカラー成分. |
[in] | x_ | ベクトル成分のx成分. |
[in] | y_ | ベクトル成分のy成分. |
[in] | z_ | ベクトル成分のz成分. |
math_quaternion.h の 49 行目に定義があります。
|
inlineconstexpr |
スカラー成分とベクトル成分を指定して初期化する. ノルムが1になるように代入すること,
使用は非推奨,MakeByAngleAxisを使うこと.
[in] | w_ | スカラー成分. |
[in] | v_ | ベクトル成分. |
math_quaternion.h の 59 行目に定義があります。
|
constexprdefault |
コピーコンストラクタ.
|
constexprdefaultnoexcept |
ムーブコンストラクタ.
|
inlineconstexprnoexcept |
クォータニオンの内積を返す. クォータニオンを4次元のベクトルとみなし,ベクトルの内積を求める.
[in] | other | 内積を求めるクォータニオン. |
math_quaternion.h の 124 行目に定義があります。
|
inlineconstexprnoexcept |
クォータニオンの共役を返す. 共役なクォータニオンとは,ベクトル成分の符号を反転させたもの
q = w + xi + yj + zk とすると, qの共役は w - xi - yj - zk となる.回転は逆方向になる
math_quaternion.h の 135 行目に定義があります。
|
inlineconstexprnoexcept |
他のクォータニオンとの距離の2乗を返す. クォータニオンを4次元ベクトルとみなし,ベクトルの距離の2乗を求める.
math_quaternion.h の 176 行目に定義があります。
|
inline |
クォータニオンの逆数を返す.
クォータニオンqの逆数q^-1は,qの共役をノルムで割ったもの.
q^-1 = q* / |q|^2
math_quaternion.h の 161 行目に定義があります。
|
inlineconstexprnoexcept |
クォータニオンの長さの2乗を返す(ノルムの2乗).
クォータニオンの長さの2乗は,w^2 + x^2 + y^2 + z^2 で求められる.
math_quaternion.h の 141 行目に定義があります。
|
inlinenoexcept |
クォータニオンのノルムを返す.
ノルムとは,ベクトルの大きさのこと. クォータニオンのノルムは,w^2 + x^2 + y^2 + z^2 の平方根で求められる.
math_quaternion.h の 151 行目に定義があります。
|
noexcept |
正規化したクォータニオンを返す.
クォータニオンの正規化とは,ノルムを1にすることを表す.
クォータニオンqの正規化は,q / |q| で求められる.
math_quaternion.cpp の 18 行目に定義があります。
|
static |
回転軸と回転角からクォータニオンを作成する.
q = cos(θ/2) * w + sin(θ/2) * { v.x + v.y + v.z } となる. ノルムは必ず1になる.
[in] | rad_angle | 回転角θ [rad] |
[in] | axis | 回転軸. |
math_quaternion.cpp の 31 行目に定義があります。
|
inlinenoexcept |
|
inlinenoexcept |
math_quaternion.h の 97 行目に定義があります。
|
inlineconstexprnoexcept |
math_quaternion.h の 84 行目に定義があります。
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
math_quaternion.h の 70 行目に定義があります。
|
inlineconstexprnoexcept |
math_quaternion.h の 72 行目に定義があります。
|
inlineconstexprnoexcept |
math_quaternion.h の 71 行目に定義があります。
|
inlineconstexprnoexcept |
math_quaternion.h の 76 行目に定義があります。
|
inlineconstexpr |
math_quaternion.h の 88 行目に定義があります。
|
inlinenoexcept |
math_quaternion.h の 99 行目に定義があります。
|
inlinenoexcept |
math_quaternion.h の 108 行目に定義があります。
|
constexprdefault |
コピー代入演算子.
|
inlinenoexcept |
|
inlinenoexcept |
math_quaternion.h の 103 行目に定義があります。
|
inlinenoexcept |
math_quaternion.h の 113 行目に定義があります。
std::string designlab::Quaternion::ToCsvString | ( | ) | const |
クォータニオンをCsv形式の文字列に変換する.カンマ区切り.
w, x, y, z の順にカンマ区切りで出力する.
math_quaternion.cpp の 51 行目に定義があります。
|
inlineconstexprnoexcept |
左手座標系への変換を行う.
言うまでもないが,機械工学では通例右手座標系を使う. しかし,dxlib は左手座標系なので,dxlib で描画するときは, この関数を使って左手座標系に変換する必要がある.
math_quaternion.h の 189 行目に定義があります。
std::string designlab::Quaternion::ToString | ( | ) | const |
クォータニオンを文字列に変換する.
w, x, y, z の順で出力する.
math_quaternion.cpp の 41 行目に定義があります。
Vector3 designlab::Quaternion::v |
ベクトル成分.
math_quaternion.h の 215 行目に定義があります。
float designlab::Quaternion::w |
スカラー成分.
math_quaternion.h の 214 行目に定義があります。