-
Notifications
You must be signed in to change notification settings - Fork 164
/
to_Q.mo
33 lines (30 loc) · 1.32 KB
/
to_Q.mo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
within Modelica.Mechanics.MultiBody.Frames.TransformationMatrices;
function to_Q
"Return quaternion orientation object Q from orientation object T"
extends Modelica.Icons.Function;
input TransformationMatrices.Orientation T
"Orientation object to rotate frame 1 into frame 2";
input Quaternions.Orientation Q_guess=Quaternions.nullRotation()
"Guess value for output Q (there are 2 solutions; the one closer to Q_guess is used";
output Quaternions.Orientation Q
"Quaternions orientation object to rotate frame 1 into frame 2";
algorithm
Q := Quaternions.from_T(T, Q_guess);
annotation(Inline=true, Documentation(info="<html>
<h4>Syntax</h4>
<blockquote><pre>
Q = TransformationMatrices.<strong>to_Q</strong>(T, Q_guess);
</pre></blockquote>
<h4>Description</h4>
<p>
This function returns a <a href=\"modelica://Modelica.Mechanics.MultiBody.Frames.Quaternions.Orientation\">quaternion object</a> Q
computed from a <a href=\"modelica://Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.Orientation\">transformation matrix</a> T
and depending on the initial guess Q_guess.
</p>
<h4>See also</h4>
<p>
<a href=\"modelica://Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.from_Q\">from_Q</a>
<a href=\"modelica://Modelica.Mechanics.MultiBody.Frames.to_Q\">Frames.to_Q</a>.
</p>
</html>"));
end to_Q;