functionfrom_nxy

Return fixed orientation object from n_x and n_y vectors

Extends from Modelica.Icons.Function (Icon for functions).

Information

Syntax

R = Frames.from_nxy(n_x, n_y);

Description

It is assumed that the two input vectors n_x and n_y are resolved in frame 1 and are directed along the x and y axis of frame 2 (i.e., n_x and n_y are orthogonal to each other). The function returns the orientation object R to rotate from frame 1 to frame 2.

The function is robust in the sense that it returns always an orientation object R, even if n_y is not orthogonal to n_x. This is performed in the following way:
If n_x and n_y are not orthogonal to each other, first a unit vector e_y is determined that is orthogonal to n_x and is lying in the plane spanned by n_x and n_y. If n_x and n_y are parallel or nearly parallel to each other, a vector e_y is selected arbitrarily such that e_x and e_y are orthogonal to each other.

See also

TransformationMatrices.from_nxy.

Inputs

TypeNameDefaultDescription
Real[3]n_xVector in direction of x-axis of frame 2, resolved in frame 1
Real[3]n_yVector in direction of y-axis of frame 2, resolved in frame 1

Outputs

TypeNameDefaultDescription
OrientationROrientation object to rotate frame 1 into frame 2