点が線(折れ線)の左右にあるか判別
2 次查看(过去 30 天)
显示 更早的评论
点が線の左右にあるか判別したいです。
ただの直線の場合は外積の関係を使うのはわかりますが、図のような折れ線になるとどのようにしたらよいかわかりません。

TEN =[
450.0000 0
437.5000 40.0000
425.0000 80.0000
412.5000 120.0000
400.0000 160.0000
371.6090 129.1747
359.1090 169.1747
387.5000 200.0000
428.3910 190.8253
440.8910 150.8253
400.0000 0
500.0000 0
383.5000 31.5000
383.5000 63.5000
383.5000 95.5000
447.5000 63.5000
447.5000 95.5000
479.5000 31.5000];
ORESEN= [
410 0
390 120
430 180
];
plot(TEN(:,1),TEN(:,2),'*')
hold on
plot(ORESEN(:,1),ORESEN(:,2))
3 个评论
Akira Agata
2019-9-29
あるいは、交点が複数あるような複雑な折れ線の場合、折れ線の両端を延長して多角形領域を作成して、inpolygon関数を使って対象の点がどちらの多角形領域内にあるかを判別する、というのはいかがでしょうか?
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!