MAL.Collinear

Previous  Next

 

ref_arr_out = MAL.Collinear( BYREF arr_out      AS ARRAY,

                             BYREF point_A      AS ARRAY,

                             BYREF point_B      AS ARRAY,

                             BYREF point_C      AS ARRAY,

                            [BYVAL rEpsilon     AS REAL=0.001],

                            [BYVAL nFrameOffset AS INTEGER=0] ) AS REFERENCE

 

ref_arr_out = MAL.Collinear( BYREF arr_out      AS ARRAY,

                             BYREF arr_in       AS ARRAY,

                             BYVAL point_A      AS INTEGER,

                             BYVAL point_B      AS INTEGER,

                             BYVAL point_C      AS INTEGER,

                            [BYVAL rEpsilon     AS REAL=0.001],

                            [BYVAL nFrameOffset AS INTEGER=0] ) AS REFERENCE

 


 

Check if points A, B and C are collinear.  Returns 1.0 if it does, 0.0 if not.  Return values are always represented as REAL.  Epsilon is the maximum deviation that points can have from a straight line.  If Epsilon is 0.0, the default is used (0.001).  If Epsilon is a negative value, then this is in Percent of the distance between point A and B.

 

Example:

 

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

' Testing Collinear

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

'

DIM Result( nFrames ) AS REAL

 

' Using Point Numbers

MAL.Collinear( Result, Position, 1, 2, 4, 5.0 )

CALL PrintArray( REF( Result ) )

 

' Copy Points to separate arrays

DIM pA( nFrames, 1, 3 ) AS REAL

DIM pB( nFrames, 1, 3 ) AS REAL

DIM pC( nFrames, 1, 3 ) AS REAL

 

pA( *, 1 ) = Position( *, 1 )

pB( *, 1 ) = Position( *, 2 )

pC( *, 1 ) = Position( *, 4 )

 

MAL.Collinear( Result, pA, pB, pC, 5.0 )

CALL PrintArray( REF( Result ) )

 

' This should be the same

CALL PrintArray( MAL.Collinear( NULL, pA, pB, pC, 5.0 ) )