2 -- { dg-options "-O3" }
4 with Opt18_Pkg
; use Opt18_Pkg
;
8 function Mag
(Item
: in Cart_Vector_Type
) return Float is
10 return Sqrt
(Item
(X
) * Item
(X
) + Item
(Y
) * Item
(Y
)
11 + Item
(Z
) * Item
(Z
));
14 function Unit_Quaternion_To_Mag_Axis
(Quaternion
: in Unit_Quaternion_Type
)
15 return Mag_Axis_Type
is
17 := Mag
(Cart_Vector_Type
'(Quaternion.X, Quaternion.Y, Quaternion.Z));
19 if Sin_Half > 3.0 * First_Order_Trig then
21 (Mag => Atan2 (Double_Trig (Unchecked_Trig_Pair (Sin_Half,
23 Axis => Unit_Vector_Type'(Quaternion
.X
/ Sin_Half
,
24 Quaternion
.Y
/ Sin_Half
,
25 Quaternion
.Z
/ Sin_Half
));