Problem

Given are two lines defined by two points each .

(i) (A/B) and (E/F)
(ii) (C/D) and (G/H)

 In which point do they intersect?

Script

x=G-C : y=H-D

v=E-A : w=F-B

IF (x*w-y*v) THEN
  mue=(v*(D-B)-w*(C-A))/(x*w-y*v)
  X=C+mue*x : Y=D+mue*y
  ELSE
  PRINT "Not defined or parallels"
  ENDIF