From 12:00 PM - 8:00 PM CST on Thursday, October 18, ni.com will be undergoing system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Table Of Contents

Cartesian Coordinate Rotation (3D Rotation (Direction)) (G Dataflow)

Last Modified: January 12, 2018

Rotates a three-dimensional Cartesian coordinate in the counterclockwise direction using the direction method.

connector_pane_image
datatype_icon

x

X-coordinate.

This input accepts the following data types:

  • Double-precision, floating-point number
  • 1D array of double-precision, floating-point numbers
datatype_icon

y

Y-coordinate.

This input accepts the following data types:

  • Double-precision, floating-point number
  • 1D array of double-precision, floating-point numbers
datatype_icon

z

Z-coordinate.

This input accepts the following data types:

  • Double-precision, floating-point number
  • 1D array of double-precision, floating-point numbers
datatype_icon

rotation matrix

3-by-3 direction angle or direction cosine matrix.

If rotation matrix type is Direction Cosines, each element in the rotation matrix must be in the range of [-1, 1].

datatype_icon

rotation matrix type

Type of the rotation matrix.

Name Value Description
Direction Angles 0 The rotation matrix contains the direction angles, or the angles between the x-, y-, and z-axes, and the line segments from the origin to the input coordinates.
Direction Cosines 1 The rotation matrix contains the direction cosines, or the cosines of the direction angles.

Default: Direction Angles

datatype_icon

error in

Error conditions that occur before this node runs.

The node responds to this input according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Default: No error

datatype_icon

rotated x

Rotated x-coordinate.

This output can return the following data types:

  • Double-precision, floating-point number
  • 1D array of double-precision, floating-point numbers
datatype_icon

rotated y

Rotated y-coordinate.

This output can return the following data types:

  • Double-precision, floating-point number
  • 1D array of double-precision, floating-point numbers
datatype_icon

rotated z

Rotated z-coordinate.

This output can return the following data types:

  • Double-precision, floating-point number
  • 1D array of double-precision, floating-point numbers
datatype_icon

error out

Error information.

The node produces this output according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Algorithm for Rotating Three-Dimensional Cartesian Coordinates Using the Direction Method

The following equation describes how this node rotates three-dimensional Cartesian coordinates using the direction method:

[ x y z ] = R [ x y z ]

where

  • x, y, and z are the x-, y-, and z-coordinates before the rotation
  • x', y', and z' are the x-, y-, and z-coordinates after the rotation
  • R is the rotation matrix you specify in rotation matrix if rotation matrix type is Direction Cosines. If rotation matrix type is Direction Angles, R = [ cos α 1 cos β 1 cos γ 1 cos α 2 cos β 2 cos γ 2 cos α 3 cos β 3 cos γ 3 ]

where

  • α1, β1, and γ1 are the direction angles of the x'-axis to the x-, y-, and z-axes
  • α2, β2, and γ2 are the direction angles of the y'-axis to the x-, y-, and z-axes
  • α3, β3, and γ3 are the direction angles of the z'-axis to the x-, y-, and z-axes

Where This Node Can Run:

Desktop OS: Windows

FPGA: Not supported

Web Server: Not supported in VIs that run in a web application


Recently Viewed Topics