Dividing a triangle into equal parts
古いコメントを表示
Hi Guys,
Can anyone tell me how can i divide a triangle into 'n' equal triangles?
I have a triangle set by 3 points P1, P2, P3. And can anyone help me with solving this problem?
2 件のコメント
Matt Fig
2012 年 11 月 14 日
Show the code you have written so far.
Anton Semechko
2012 年 11 月 14 日
When you say equal, do you mean the triangles should have equal areas?
回答 (2 件)
Image Analyst
2012 年 11 月 14 日
0 投票
Can't you use polyarea() to get the area of P1P2P3, and then, with a P4 inside the triangle, use polyarea() again to get the area of the 3 interior triangles. Then use fzero() to minimize 3*totalArea - area1-area2-area3?
Is this a homework problem?
Anton Semechko
2012 年 11 月 14 日
編集済み: Anton Semechko
2012 年 11 月 14 日
0 投票
Suppose you have a triangle defined by the vertices A, B and C. To subdivide this triangle into n triangles of equal area you can do the following:
1) Insert n-1 points along the edge AB
2) Connect new points to C to form n new triangles
3) Use the fact that the desired of area of each triangle is area(ABC)/n to adjust the positions of newly inserted points. Note that contrary to the suggestion given by Image Analyst, no optimization is required to compute new positions.
3 件のコメント
Image Analyst
2012 年 11 月 14 日
Good point. I didn't think of it like that. I was thinking that the original sides would each be the base of a triangle and the vertex would be somewhere inside the original triangle, but your way is an alternate way of chopping up the triangle into parts that is easier to solve.
Walter Roberson
2012 年 11 月 14 日
My recollection is that equally spaced points gives the desired solution, but an immediate proof of that is not coming to mind.
Image Analyst
2012 年 11 月 14 日
Well if one point is fixed, and you divide the base by 3 then the area will be 1/3 the original area since the area is base*height/2 and the height is the same and the base is 1/3 the original base.
カテゴリ
ヘルプ センター および File Exchange で Polynomials についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!