MAL.Between

Previous  Next

 

ref_arr_out = MAL.Between( BYREF arr_out      AS ARRAY,

                           BYREF point_A      AS ARRAY,

                           BYREF point_B      AS ARRAY,

                           BYREF point_C      AS ARRAY,

                          [BYVAL nFrameOffset AS INTEGER=0] ) AS REFERENCE

 

ref_arr_out = MAL.Between( 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 nFrameOffset AS INTEGER=0] ) AS REFERENCE

 


 

Check if (A, B, C) are collinear and point C lies on the closed segement AB.  Returns 1.0 if it does, 0.0 if not.  Return values are always represented as REAL.

 

Example:

 

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

' Testing Between

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

'

DIM Result( nFrames ) AS REAL

 

' Using Point Numbers

MAL.Between( Result, Position, 1, 2, 4 )

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.Between( Result, pA, pB, pC )

CALL PrintArray( REF( Result ) )

 

' This should be the same

CALL PrintArray( MAL.Between( NULL, pA, pB, pC ) )