26.12.2012 Views

ICAM Virtual Machine V19 - Kxcad.net

ICAM Virtual Machine V19 - Kxcad.net

ICAM Virtual Machine V19 - Kxcad.net

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

4.4.5.5 Vector Functions<br />

$FVADD Vector addition<br />

$FVANG Angle (degrees) between two vectors<br />

$FVCROSS Vector cross product<br />

$FVDOT Vector dot product<br />

$FVLEN Vector length<br />

$FVMULT Vector multiplication<br />

$FVNORM Vector normalization<br />

$FVROTN Normalized vector rotation<br />

$FVSUB Vector subtraction<br />

<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />

Simulation Macro Functions, Vector Functions<br />

All vector functions work with sequences of length 2 or 3 that typically define the XY or XYZ<br />

components (commonly referred to as the IJK components) of a vector. With the exception of the<br />

angle and cross product functions, vector functions can take vectors of any length. For those<br />

functions that take 2 input vectors, both vectors should have the same length. Vector functions<br />

that return a vector do so by returning a sequence with the same length as that of the shortest<br />

input vector.<br />

Vectors can be constructed using the $FSEQ function or the { } sequence operators. For example,<br />

the following are equivalent:<br />

V1=$FSEQ(0,0,1)<br />

V1={0,0,1}<br />

It is important to note that vectors are sequences and not arrays. Vector functions do not work<br />

with arrays.<br />

The $FVADD Function<br />

result=$FVADD(v1,v2)<br />

Returns: Sequence<br />

This function adds two arbitrarily long vector sequences v1 and v2, and returns the result as a<br />

vector sequence.<br />

The $FVANG Function<br />

result=$FVANG(v1,v2)<br />

Returns: Sequence or $NULL<br />

This function returns the angle in degrees between two vector sequences v1 and v2. The input<br />

vectors v1 and v2 must be sequences of length 2 or 3 only (a diagnostic is output and a value of<br />

$NULL is returned if the input vectors have less than 2 or more than 3 elements). They should<br />

also have a non-zero length to return a meaningful result.<br />

<strong>ICAM</strong> Technologies Corporation – Proprietary 159

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!