INTERSECT
INTERSECT Ax, Ay, Bx, By, Cx, Cy, Dx, Dy, BYREF type, BYREF Rx, BYREF Ry
Calculates the intersection of two line segments AB and CD given by
the point Ax
, Ay
, Bx
,
By
and Cx
, Cy
, Dx
,
Dy
.
Returns:
- Rx, Ry = coordinates of crossing point.
- type = cross-type:
- 0: No cross (R = external cross)
- 1: One cross
- 2: Parallel
- 3: Parallel (many crosses)
- 4: The cross is one of the line segments edges.
Example
' Line segment AB
50
Ax = 50
Ay = 100
Bx = 100
By =
' Line segment CD
100
Cx = 50
Cy = 50
Dx = 100
Dy =
intersect Ax, Ay, Bx, By, Cx, Cy, Dx, Dy, type, Rx, Ry
print "Intersection at x = "; Rx; ", y = "; Ry
' Draw lines and a circle at the calculated crossing point
line Ax, Ay, Bx, By color 5
line Cx, Cy, Dx, Dy color 8
circle Rx,Ry, 5 color 12
Code samples using INTERSECT
Math
ABS
ABSMAX
ABSMIN
ACOS
ACOSH
ACOT
ACOTH
ACSC
ACSCH
ASEC
ASECH
ASIN
ASINH
ATAN
ATAN2
ATANH
ATN
CEIL
COS
COSH
COT
COTH
CSC
CSCH
DEG
DERIV
DETERM
DIFFEQN
EXP
EXPRSEQ
FIX
FLOOR
FRAC
INT
INTERSECT
INVERSE
LINEQN
LOG
LOG10
M3APPLY
M3IDENT
M3ROTATE
M3SCALE
M3TRANS
MAX
MIN
POLYAREA
POLYCENT
POLYEXT
POW
PTDISTLN
PTDISTSEG
PTSIGN
RAD
RND
ROOT
ROUND
SEC
SECH
SEGCOS
SEGLEN
SEGSIN
SEQ
SGN
SIN
SINH
SQR
STATMEAN
STATMEANDEV
STATMEDIAN
STATSPREADP
STATSPREADS
STATSTD
SUM
SUMSQ
TAN
TANH
TRANSPOSE
If there is insufficient information on this page and you wish learn more about INTERSECT,
please send an email to smallbasic@gmail.com. You can help to improve information about
INTERSECT by submitting a pull request,
click View Source for details. Note, an offline language reference text file is also available - see the Download section.