# Cartesian Coordinate Shift (2D Shift) (G Dataflow)

Shifts two-dimensional Cartesian coordinates along the x- and y-axes.

This node shifts points within a fixed coordinate system.

## x

X-coordinate.

This input accepts the following data types:

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

## y

Y-coordinate.

This input accepts the following data types:

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

## shift

Shift amount along each of the axes.

The sign of dx or dy is set to positive if you shift the coordinate in the default direction of Cartesian coordinate shift and negative if you shift the coordinate in the opposite of the default shift direction.

### dx

Shift amount along the x-axis.

Default: 0

### dy

Shift amount along the y-axis.

Default: 0

## 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

## shifted x

Shifted x-coordinate.

This output can return the following data types:

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

## shifted y

Shifted y-coordinate.

This output can return the following data types:

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

## 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 Shifting Two-Dimensional Cartesian Coordinates

The following illustration demonstrates how this node shifts two-dimensional Cartesian coordinates in the default direction of Cartesian coordinate shift, which means the signs of dx and dy are both set to positive.

Before the shift, the coordinate of point P is (x, y). After the shift operation, the coordinate of point P is (x', y'), which is defined by the following equation:

$\left\{\begin{array}{c}x\prime =x+dx\\ y\prime =y+dy\end{array}$

where

• dx is the shift amount along the x-axis
• dy is the shift amount along the y-axis

Where This Node Can Run:

Desktop OS: Windows

FPGA: This product does not support FPGA devices