0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Quaternion クオータニオン メモ

Last updated at Posted at 2023-03-12

ロボットポータル
https://qiita.com/carpenders/items/1a653b1ca831547c92d3

クォータニオンからオイラー角

番号はEulerAngles.{cpp,h}の実装を示す
1 https://mtkbirdman.com/unity-quaternion-euler
2 https://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q12246836467
3 https://www.kazetest.com/vcmemo/quaternion/quaternion.htm
4 https://qiita.com/edo_m18/items/5db35b60112e281f840e 以下が類似
https://it-lives-vainly.hatenablog.com/entry/20070829/1188384519
5 https://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles#Quaternion_to_Euler_angles_(in_3-2-1_sequence)_conversion
11 https://qiita.com/aa_debdeb/items/abe90a9bd0b4809813da

回転行列からオイラー角

https://programming-surgeon.com/script/euler-angle/
https://www.kazetest.com/vcmemo/euler2rotationmatrix/euler2rotationmatrix.htm

クォータニオン

https://qiita.com/drken/items/0639cf34cce14e8d58a5 全般
https://kumadasu.com/2017/09/20/ 全般 回転の差分
https://qiita.com/aa_debdeb/items/3d02e28fb9ebfa357eaf 相互変換
https://qiita.com/aa_debdeb/items/abe90a9bd0b4809813da 相互変換実装
http://marupeke296.sakura.ne.jp/DXG_No58_RotQuaternionTrans.html 相互変換、オイラー角無し
https://risalc.info/src/quaternion-rotation.html イマイチ
http://www.info.hiroshima-cu.ac.jp/~miyazaki/knowledge/tech0052.html MtoQ
https://lipoyang.hatenablog.com/entry/2020/03/26/082622 イマイチ
https://kamino.hatenablog.com/entry/rotation_expressions イマイチ
https://www.mesw.co.jp/business/report/pdf/mss_18_07.pdf
https://zenn.dev/mebiusbox/books/132b654aa02124/viewer/2966c7 数式説明 加減算
https://stacstar.jp/blog/?p=53 イマイチ
https://www.kazetest.com/vcmemo/quaternion/quaternion.htm クォータニオンからオイラー角
https://it-lives-vainly.hatenablog.com/entry/20070829/1188384519 回転行列からオイラー角

回転行列 クォータニオン 変換 c++

https://gist.github.com/AtsushiSakai/5175898 Eigen使用
https://w.atwiki.jp/opengl/pages/148.html 相互変換 4元数線形補間
https://www2.sonycsl.co.jp/person/nielsen/visualcomputing/programs/rotation-by-quaternion.cpp QtoM
https://www.flipcode.com/documents/matrfaq.html 相互変換 Q54 Q55

クォータニオン 球面線形補間

https://yuki-koyama.hatenablog.com/entry/2013/01/19/163421
https://edom18.hateblo.jp/entry/2018/06/25/084023
http://blog.livedoor.jp/tek_nishi/archives/8623876.html 使用例
https://www2.sonycsl.co.jp/person/nielsen/visualcomputing/programs/slerp.cpp 実装
Eigen\src\Geometry\Quaternion.h slerp実装

Windows版クォータニオン

四元数構造
https://learn.microsoft.com/ja-jp/windows/win32/numerics_h/quaternion-structure

Eigen

http://modeling-lab.pinoko.jp/programming/eigen.html 入門
https://www.regentechlog.com/2018/12/09/eigen-note/ 注意点
https://www.insilico.jp/blog/2022/05/08/lalibrary_eigen_part1/ 入門
https://stackoverflow.com/questions/60758298/eigenmatrixdouble-4-4-to-eigenquaterniond Eigen::Quaterniondは3x3行列から変換
https://gist.github.com/AtsushiSakai/5175898 Eigen使用例
https://lilaboc.work/archives/19488603.html Eigen使用例
http://blog.livedoor.jp/tek_nishi/archives/8623876.html Eigen使用例 良い
https://kukku2123.hatenablog.com/entry/2018/01/17/180000 Eigen使用例 良い
https://www.cc.gatech.edu/classes/AY2015/cs4496_spring/Eigen.html Eigen使用例
https://qiita.com/vs4sh/items/7e8bc95250db8d88bc41 Eigen使用例
https://stackoverflow.com/questions/8443102/convert-eigen-matrix-to-c-array Eigen配列
https://eigen.tuxfamily.org/dox/group__TopicStorageOrders.html 本家StorageOrder
http://ankokudan.org/d/dl/pdf/pdf-eigennote.pdf
https://stackoverflow.com/questions/21761909/eigen-convert-matrix3d-rotation-to-quaternion QtoM
https://myenigma.hatenablog.com/entry/20130719/1374304154 QtoEulerAngles
メモリの使い方を自分で調査

static void verifymatrix()
{
	size_t i;
	Eigen::Matrix2i aaa{ {1,2},{3,4} }; // colum major
	for (i = 0; i < 4; i++) {
		static const int ary1[] = { 1,3,2,4 };
		VERIFY(ary1[i] == *(aaa.data() + i));
	}
	VERIFY(aaa(0, 0) == 1);
	VERIFY(aaa(0, 1) == 2);
	VERIFY(aaa(1, 0) == 3);
	VERIFY(aaa(0) == 1);
	VERIFY(aaa(1) == 3);
	VERIFY(aaa(2) == 2);
	Eigen::Matrix2i bbb;
	bbb << 1, 2, 3, 4; // colum major
	for (i = 0; i < 4; i++) {
		static const int ary1[] = { 1,3,2,4 };
		VERIFY(ary1[i] == *(bbb.data() + i));
	}
	VERIFY(bbb(0, 0) == 1);
	VERIFY(bbb(0, 1) == 2);
	VERIFY(bbb(1, 0) == 3);
	VERIFY(bbb(0) == 1);
	VERIFY(bbb(1) == 3);
	VERIFY(bbb(2) == 2);
	Eigen::Matrix<int, 2, 2, Eigen::RowMajor> ccc; // row major
	ccc << 1, 2, 3, 4;
	for (i = 0; i < 4; i++) {
		static const int ary1[] = { 1,2,3,4 };
		VERIFY(ary1[i] == *(ccc.data() + i));
	}
	VERIFY(ccc(0, 0) == 1);
	VERIFY(ccc(0, 1) == 2);
	VERIFY(ccc(1, 0) == 3);
	VERIFY(ccc(0) == 1);
	VERIFY(ccc(1) == 2);
	VERIFY(ccc(2) == 3);
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?