Friday, May 4, 2012

How do I tell if two line segments are intercepting?I have a line segment going from (2,2) to (3,5), and another going from (7,2) (3,0), which...

Two lines which are not parallel to each other are
intersecting. As your question mentions line segments there could be a possibility that
they don't intersect but if they are extended to form complete lines, they will
intersect if they are not parallel.


Let's take the lines
passing through the points you have provided. To calculate the slope of a line passing
through (x1, y1) and (x2, y2) we need to evaluate: (y2 - y1) / (x2 -
x1)


(2, 2) and (3, 5): the slope of the line through them
is (5 - 2) / (3 - 2) = 3.


(7, 2) and (3, 0): the slope of
the line through them is (2- 0)/ (7 - 3) = 2 / 4 =
1/2.


Therefore the lines passing through the
given sets of points are intersecting as the slopes are not
equal.

No comments:

Post a Comment

Calculate tan(x-y), if sin x=1/2 and sin y=1/3. 0

We'll write the formula of the tangent of difference of 2 angles. tan (x-y) = (tan x - tan y)/(1 + tan x*tan y) ...