Divooka Reference

Vector 2D

17 nodes

On this page 17

X

Function

The X coordinate.

Signature
X(Vector 2D: Vector 2D) -> Number
double X(Vector2D Vector 2D)

Parameters

nametypedefaultdescription
Vector 2DVector 2D—

Returns

resultNumber
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector 2D
Package
Image Processing

Y

Function

The Y coordinate.

Signature
Y(Vector 2D: Vector 2D) -> Number
double Y(Vector2D Vector 2D)

Parameters

nametypedefaultdescription
Vector 2DVector 2D—

Returns

resultNumber
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector 2D
Package
Image Processing

Zero

Function

Gets a Types.Vector2D that has all of its values set to zero.

Signature
Zero() -> Vector 2D
Vector2D Zero()

Returns

resultVector 2D
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector 2D
Package
Image Processing

Make Vector 2D

Function

Overload 1 of 2

Signature
Vector2D(x: Number, y: Number) -> Vector 2D
Vector2D Vector2D(double x, double y)

Initializes a new instance of the Types.Vector2D struct with the specified coordinates.

Parameters

nametypedefaultdescription
xNumber—The X coordinate.
yNumber—The Y coordinate.

Returns

resultVector 2D

Remarks

Marked for JSON so that a serializer can rebuild one. Vector2D.X and Vector2D.Y are readonly
*fields*, which a serializer can read but cannot assign, so without a constructor to call every
deserialized vector came back as (0, 0) - which, since node positions are vectors, silently collapsed
a whole document's layout onto the origin.

Overload 2 of 2

Signature
Vector2D(v: Vector2) -> Vector 2D
Vector2D Vector2D(Vector2 v)

Initializes a new instance of the Types.Vector2D struct using a Numerics.Vector2.

Parameters

nametypedefaultdescription
vVector2—A Numerics.Vector2 instance from which to initialize the coordinates.

Returns

resultVector 2D
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector 2D
Package
Image Processing

Length

Function

Gets the length (magnitude) of the vector.

Signature
Length(Vector 2D: Vector 2D) -> Number
double Length(Vector2D Vector 2D)

Parameters

nametypedefaultdescription
Vector 2DVector 2D—

Returns

resultNumber
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector 2D
Package
Image Processing

Length Squared

Function

Calculates the square of the vector's length.

Signature
LengthSquared(Vector 2D: Vector 2D) -> Number
double LengthSquared(Vector2D Vector 2D)

Parameters

nametypedefaultdescription
Vector 2DVector 2D—

Returns

resultNumber
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector 2D
Package
Image Processing

To String

Function

This node carries no documentation.

Signature
ToString(Vector 2D: Vector 2D) -> Text
string ToString(Vector2D Vector 2D)

Parameters

nametypedefaultdescription
Vector 2DVector 2D—

Returns

resultText
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector 2D
Package
Image Processing

Distance Squared

Function

Calculates the square of the distance between two vectors.

Signature
DistanceSquared(a: Vector 2D, b: Vector 2D) -> Number
double DistanceSquared(Vector2D a, Vector2D b)

Parameters

nametypedefaultdescription
aVector 2D—The first Types.Vector2D.
bVector 2D—The second Types.Vector2D.

Returns

resultNumber
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector 2D
Package
Image Processing

Dot

Function

Calculates the dot product of two vectors.

Signature
Dot(a: Vector 2D, b: Vector 2D) -> Number
double Dot(Vector2D a, Vector2D b)

Parameters

nametypedefaultdescription
aVector 2D—The first Types.Vector2D.
bVector 2D—The second Types.Vector2D.

Returns

resultNumber
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector 2D
Package
Image Processing

Addition Operation

Function

Adds two Types.Vector2D instances.

Signature
op_Addition(a: Vector 2D, b: Vector 2D) -> Vector 2D
Vector2D op_Addition(Vector2D a, Vector2D b)

Parameters

nametypedefaultdescription
aVector 2D—The first Types.Vector2D.
bVector 2D—The second Types.Vector2D.

Returns

resultVector 2D
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector 2D
Package
Image Processing

Division Operation

Function

Divides a Types.Vector2D by a scalar.

Signature
op_Division(a: Vector 2D, b: Number) -> Vector 2D
Vector2D op_Division(Vector2D a, double b)

Parameters

nametypedefaultdescription
aVector 2D—The Types.Vector2D to divide.
bNumber—The scalar value.

Returns

resultVector 2D
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector 2D
Package
Image Processing

Equality Operation

Function

Compares two Types.Vector2D instances for equality.

Signature
op_Equality(a: Vector 2D, b: Vector 2D) -> Truth
bool op_Equality(Vector2D a, Vector2D b)

Parameters

nametypedefaultdescription
aVector 2D—The first Types.Vector2D.
bVector 2D—The second Types.Vector2D.

Returns

resultTruth
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector 2D
Package
Image Processing

Inequality Operation

Function

Compares two Types.Vector2D instances for inequality.

Signature
op_Inequality(a: Vector 2D, b: Vector 2D) -> Truth
bool op_Inequality(Vector2D a, Vector2D b)

Parameters

nametypedefaultdescription
aVector 2D—The first Types.Vector2D.
bVector 2D—The second Types.Vector2D.

Returns

resultTruth
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector 2D
Package
Image Processing

Multiply Operation

Function

Overload 1 of 2

Signature
op_Multiply(a: Vector 2D, b: Number) -> Vector 2D
Vector2D op_Multiply(Vector2D a, double b)

Multiplies a Types.Vector2D by a scalar.

Parameters

nametypedefaultdescription
aVector 2D—The Types.Vector2D to multiply.
bNumber—The scalar value.

Returns

resultVector 2D

Overload 2 of 2

Signature
op_Multiply(a: Number, b: Vector 2D) -> Vector 2D
Vector2D op_Multiply(double a, Vector2D b)

Multiplies a scalar by a Types.Vector2D.

Parameters

nametypedefaultdescription
aNumber—The scalar value.
bVector 2D—The Types.Vector2D to multiply.

Returns

resultVector 2D
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector 2D
Package
Image Processing

Subtraction Operation

Function

Subtracts one Types.Vector2D from another.

Signature
op_Subtraction(a: Vector 2D, b: Vector 2D) -> Vector 2D
Vector2D op_Subtraction(Vector2D a, Vector2D b)

Parameters

nametypedefaultdescription
aVector 2D—The first Types.Vector2D.
bVector 2D—The second Types.Vector2D to subtract from the first.

Returns

resultVector 2D
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector 2D
Package
Image Processing

Unary Negation Operation

Function

Negates a Types.Vector2D.

Signature
op_UnaryNegation(a: Vector 2D) -> Vector 2D
Vector2D op_UnaryNegation(Vector2D a)

Parameters

nametypedefaultdescription
aVector 2D—The Types.Vector2D to negate.

Returns

resultVector 2D
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector 2D
Package
Image Processing

Parse Tuple

Function

This node carries no documentation.

Signature
ParseTuple(tuple: Text) -> Vector 2D
Vector2D ParseTuple(string tuple)

Parameters

nametypedefaultdescription
tupleText—

Returns

resultVector 2D
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector 2D
Package
Image Processing