Determining if the circle intersects the given triangle

Hi, This is coming up when I am doing Finite Element Method: I've triangulation of the rectangle in 2d, and I am looping over the triangles. I also have few circle inside the rectangle. When I am in a current triangle, I want to find out if it intersects any of those circle, and if yes, how it intersects them, e.g. if it intersects one of the vertices, or only edges, or both. thanks

回答 (2 件)

John D'Errico
John D'Errico 2011 年 12 月 17 日

0 投票

We won't do your homework for you. This is just basic geometry. So do it.
1. Write down what it means for these objects to intersect. Do it on paper, forcing yourself to think clearly. If you don't bother thinking clearly about a problem, you cannot solve it. What must happen for an intersection?
2. Given the above step, define a set of tests to determine if there is an intersection.
3. Write matlab code for the above.
Only you can do this. And only you care about the result, as it is your homework, not ours.

1 件のコメント

Aziz
Aziz 2011 年 12 月 17 日
I do know how to do it using loops, but is it little longer. I was wondering if there is an easier way. E.g. can we define regions in matlab, e.g. if we have the vertices can we define triangle etc.

サインインしてコメントする。

Image Analyst
Image Analyst 2011 年 12 月 17 日

0 投票

Try the function called something like inpolygon(). If you know the perimeter coordinates, you're all set.

カテゴリ

ヘルプ センター および File ExchangeData Import from MATLAB についてさらに検索

質問済み:

2011 年 12 月 17 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by