Distance along the perpendicular line
1 回表示 (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!