DriveWorks Pro 18: VectorLerp [send feedback...]

VectorLerp

This function linearly interpolates between two vectors based on a given weighting amount, and returns the result as a pipe-bar delimited list.

Syntax

VectorLerp([Vector 1], [Vector 2], [Amount])

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).

Amount is the interpolation weighting amount (where 0 results in Vector 1 and 1 results in Vector 2).

Examples

RuleResult
VectorLerp("1|1|1","2|3|4",0)Will return the first vector, 1|1|1.
VectorLerp("1|1|1","2|3|4",1)Will return the second vector, 2|3|4.
VectorLerp("1|1|1","2|3|4",0.5)Will return, 1.5|2|2.5.
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.

Table of Contents