赞
踩
设四元数为:
q
=
(
w
,
x
,
y
,
z
)
q = (w, x, y, z)
q=(w,x,y,z)
对应欧拉角为:
则四元数到欧拉角的转换公式为:
w
=
cos
(
θ
2
)
cos
(
ϕ
2
)
cos
(
ψ
2
)
+
sin
(
θ
2
)
sin
(
ϕ
2
)
sin
(
ψ
2
)
x
=
sin
(
θ
2
)
cos
(
ϕ
2
)
cos
(
ψ
2
)
−
cos
(
θ
2
)
sin
(
ϕ
2
)
sin
(
ψ
2
)
y
=
cos
(
θ
2
)
sin
(
ϕ
2
)
cos
(
ψ
2
)
+
sin
(
θ
2
)
cos
(
ϕ
2
)
sin
(
ψ
2
)
z
=
cos
(
θ
2
)
cos
(
ϕ
2
)
sin
(
ψ
2
)
−
sin
(
θ
2
)
sin
(
ϕ
2
)
cos
(
ψ
2
)
θ
=
arcsin
(
2
(
w
⋅
y
−
z
⋅
x
)
)
ϕ
=
arctan
2
(
2
(
w
⋅
x
+
y
⋅
z
)
,
1
−
2
(
x
2
+
y
2
)
)
ψ
=
arctan
2
(
2
(
w
⋅
z
+
x
⋅
y
)
,
1
−
2
(
y
2
+
z
2
)
)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。