Home Search

DriveWorks Pro 22
VectorSubtract

Send Feedback

VectorSubtract

This function subtracts the second vector from the first, and returns the result as a pipe-bar delimited list.

Syntax

VectorSubtract([Vector 1], [Vector 2])

Where:

Vector 1 is a pipe-bar delimited list representing the first vector (X|Y|Z).

Vector 2 is a pipe-bar delimited list representing the second vector (X|Y|Z).

Examples

RuleResult
VectorSubtract("5|8","2|1")Will return the result of the two subtracted 2D vectors, 3|7.
VectorSubtract("5|8|13","2|1|4")Will return the result of the two subtracted 3D vectors, 3|7|9.
Floating Point Precision

Due to floating point precision, some calculations may not be as precise as expected.

This can be avoided by following the advice in the topic Info: Floating Point Precision.


Please see How To: Understanding Vector Functions for more information on Vectors, all the Vector functions provided in DriveWorks and use case examples.