Can someone help with this code. It checks if an object is in-front of another by only using slops. There are some glitches with the logic(namely using exactly .5pi and 1.5pi), but the idea works on paper.

`DIM ac AS SINGLE`

DIM ao AS SINGLE

DIM a AS SINGLE

DIM w AS SINGLE

check = 0

INPUT "a ", a

INPUT "w ", w

INPUT "y ", y

INPUT "x ", x

ex = 0

ey = 0

cy = 1

cx = 1

'get slopes

ao = (y - ey) / (x - ex)

ac = (y - cy) / (x - cx)

'cheack code for object

IF ao < TAN(a) THEN

check1 = 1

ELSE check1 = 0

END IF

IF ao > TAN(a + w) THEN

check2 = 1

ELSE check2 = 0

END IF

'cheack code for cheack

IF ac < TAN(a) THEN

check3 = 1

ELSE check3 = 0

END IF

IF ac > TAN(a + w) THEN

check4 = 1

ELSE check4 = 0

END IF

'cheack if codes are the same

IF check1 = check3 THEN

IF check2 = check4 THEN

check = 1

END IF

END IF

PRINT check, check1, check2, check3, check4