Please enable JavaScript to view this site.

Function to perform a third-order polynomial.

Two cams can be set, and through an appropriate par parameter it is possible to switch between cams.

Syntax

real mv_cam (real xCurr, i32 nSegm1, stru_matcam stru1 [, real par=0] [, i32 nSegm2=0] [, stru_matcam stru2=NULL] )

xCurr

Current master value (abscissa)

nPoints1

Number of points of which the first polynomial cam is composed.

Must match the length of the array of stru1

stru1

Array of structures of type stru_matcam containing the values of the first cam.

NOTE: Must be initialized as an array.

par

Mixer parameter that allows switching between the two cams. (optional, default 0)

Value

Meaning

0

Performs cam 1

0 -:- 1 (extremes not included)

Performs a weighted overlap of the two cams

1

Performs cam 2

nPoints2

Number of points of which the second polynomial cam is composed. (optional, default 0)

Must match the length of the array of stru2

stru2

Array of structures of type stru_matcam containing the values of the second cam. (optional, default NULL)

NOTE: Must be initialized as an array.

Result

Updated result value, corresponding to the y-coordinates of the cam.

The result is calculated as:

dx1 = xCurr - xInitial1

dx2 = xCurr - xInitial2

result = (((a1*dx1^3) + (b1*dx1^2) + (c1*dx1) + d1) * (1-par)) + (((a2*dx2^3) + (b2*dx2^2) + (c2*dx2) + d2) * par)

Validity

Rule

Note

Parameters a, b, c, d must be given as input to the function

 

  

Keyboard Navigation

F7 for caret browsing
Hold ALT and press letter

This Info: ALT+q
Page Header: ALT+h
Topic Header: ALT+t
Topic Body: ALT+b
Contents: ALT+c
Search: ALT+s
Exit Menu/Up: ESC