Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
2点間に何かがあるかどうかを確認する方法はありますか?
たとえば、A と C の 2 つの点があります。
もしも
ABC
の場合、メソッドは を返しますtrueが、
true
交流 B
、それらは同じ行にないため、 が返されfalseます。
false
最も簡単な (おそらく最も効率的な方法ではない) 方法は、A と C の間の線形方程式を計算し、B がそれを満たすかどうかを確認することです。そうであれば、B が A と C の間のスペースにあるかどうかを確認します。これは簡単です (Bx を Ax および Cx と比較し、By を Ay および Cy と比較します)。