MAL.Intersect

Previous  Next

 

ref_arr_out = MAL.Intersect( BYREF arr_out      AS ARRAY,

                             BYREF point_A      AS ARRAY,

                             BYREF point_B      AS ARRAY,

                             BYREF point_C      AS ARRAY,

                             BYREF point_D      AS ARRAY,

                            [BYVAL bProperly    AS INTEGER=FALSE],

                            [BYVAL nFrameOffset AS INTEGER=0] ) AS REFERENCE

 

ref_arr_out = MAL.Intersect( 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 point_D      AS INTEGER,

                            [BYVAL bProperly    AS INTEGER=FALSE],

                            [BYVAL nFrameOffset AS INTEGER=0] ) AS REFERENCE

 


 

Check if segments AB and CD intersect.  Returns 1.0 if it does, 0.0 if not.  Return values are always represented as REAL.

 

Example:

 

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

' Testing Intersect

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

'

DIM Result( nFrames ) AS REAL

 

' Using Point Numbers

MAL.Intersect( Result, Position, 1, 2, 3, 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

DIM pD( nFrames, 1, 3 ) AS REAL

 

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

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

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

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

 

MAL.Intersect( Result, pA, pB, pC, pD )

CALL PrintArray( REF( Result ) )

 

' This should be the same

CALL PrintArray( MAL.Intersect( NULL, pA, pB, pC, pD ) )