点が線(折れ線)の左右にあるか判別
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
点が線の左右にあるか判別したいです。
ただの直線の場合は外積の関係を使うのはわかりますが、図のような折れ線になるとどのようにしたらよいかわかりません。

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 Commenti
Akira Agata
il 29 Set 2019
あるいは、交点が複数あるような複雑な折れ線の場合、折れ線の両端を延長して多角形領域を作成して、inpolygon関数を使って対象の点がどちらの多角形領域内にあるかを判別する、というのはいかがでしょうか?
Risposte (0)
Vedere anche
Categorie
Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!