Reputation:
i wrote algorithm for calculate intersection point of two line
but it works only for slope lines
i want algorithm to calculate intersection point for horizontal and vertical Lines
Upvotes: 2
Views: 1801
Reputation: 2706
the intersection between a horizontal and a vertical line is trivial. Assume the horizontal line is defined by
y = c1
and the vertical line by
x = c2
(where c1 and c2 are your constants)
then the intersection is (c2;c1).
In the example you gave : c2 = 1 ; c1 = 6 and the intersectoin is (1;6)
Upvotes: 6