![]() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
The NV macros have the same purpose as ND macros, but they operate on vectors (i.e., arrays of length ND_ND) instead of separate components.
NV_V
The utility NV_V performs an operation on two vectors.
NV_V(a, =, x); a[0] = x[0]; a[1] = x[1]; etc. |
Note that if you use + = instead of = in the above equation, then you get
a[0]+=x[0]; etc. |
See Section 2.6.4 for an example UDF that utilizes NV_V.
NV_VV
The utility NV_VV performs operations on vector elements. The operation that is performed on the elements depends upon what symbol ( -,/,*) is used as an argument in place of the + signs in the following macro call.
NV_VV(a, =, x, +, y) 2D: a[0] = x[0] + y[0], a[1] = x[1] + y[1]; |
See Section 2.6.4 for an example UDF that utilizes NV_VV.
NV_V_VS
The utility NV_V_VS adds a vector to another vector which is multiplied by a scalar.
NV_V_VS(a, =, x, +, y, *, 0.5); 2D: a[0] = x[0] + (y[0]*0.5), a[1] = x[1] +(y[1]*0.5); |
Note that the + sign can be replaced by -, /, or *, and the * sign can be replaced by /.
NV_VS_VS
The utility NV_VS_VS adds a vector to another vector which are each multiplied by a scalar.
NV_VS_VS(a, =, x, *, 2.0, +, y, *, 0.5); 2D: a[0] = (x[0]*2.0) + (y[0]*0.5), a[1] = (x[1]*2.0) + (y[1]*0.5); |
Note that the + sign can be used in place of -, *, or /, and the * sign can be replaced by /.