Distance along the perpendicular line
1 view (last 30 days)
Show older comments
I have two line segments seg1 and seg2. The starting and ending points of each line segment is known. For example seg1=(x1,y1),(x2,y2) and seg2=(x3,y3),(x4,y4). I want to draw a perpendicular line through the mid point of seg1 (let's assume the mid point is (x0,y0)). Then I want to check whether this perpendicular line touches(crosses) seg2. If it crosses, then I want to calculate the distance along the perpendicular line to this crossing point(not the perpendicular distance from (x0,y0) to the crossing point/seg2)
Furthermore, I want to find the sign (+ or -) of the distance. i.e: If the seg2 is on the right side, the sign should be positive(+) and if it is on left, the sign should be negative (-).
Please help.
5 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!