simplified statement
This commit is contained in:
parent
2dd0e06b24
commit
a165b7b68c
|
@ -1645,14 +1645,14 @@ pure function math_qToAxisAngle(Q)
|
||||||
real(pReal) :: halfAngle, sinHalfAngle
|
real(pReal) :: halfAngle, sinHalfAngle
|
||||||
real(pReal), dimension(4) :: math_qToAxisAngle
|
real(pReal), dimension(4) :: math_qToAxisAngle
|
||||||
|
|
||||||
halfAngle = acos(max(-1.0_pReal, min(1.0_pReal, Q(1)))) ! limit to [-1,1] --> 0 to 180 deg
|
halfAngle = acos(math_limit(Q(1),-1.0_pReal,1.0_pReal))
|
||||||
sinHalfAngle = sin(halfAngle)
|
sinHalfAngle = sin(halfAngle)
|
||||||
|
|
||||||
if (sinHalfAngle <= 1.0e-4_pReal) then ! very small rotation angle?
|
smallRotation: if (sinHalfAngle <= 1.0e-4_pReal) then
|
||||||
math_qToAxisAngle = 0.0_pReal
|
math_qToAxisAngle = 0.0_pReal
|
||||||
else
|
else smallRotation
|
||||||
math_qToAxisAngle= [ Q(2:4)/sinHalfAngle, halfAngle*2.0_pReal]
|
math_qToAxisAngle= [ Q(2:4)/sinHalfAngle, halfAngle*2.0_pReal]
|
||||||
endif
|
endif smallRotation
|
||||||
|
|
||||||
end function math_qToAxisAngle
|
end function math_qToAxisAngle
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue