How do you plot a 3D circle segment?
5 ビュー (過去 30 日間)
古いコメントを表示
Laurence hutton-smith
2015 年 5 月 21 日
回答済み: Image Analyst
2015 年 5 月 28 日
It seems very straightforward to plot 3D polygons using fill3, however instead of a polygon is there a way to plot a circle segment?
Say we have 3 points in space, which represent the centre of the circle and two points on it's circumference, how can I draw the filled arc segment between these two points?
0 件のコメント
採用された回答
Cindy Solomon
2015 年 5 月 22 日
編集済み: Cindy Solomon
2015 年 5 月 22 日
Hi Laurence,
There is no built-in function to plot a segment of a circle. However, it is still possible to do with combinations of existing functions in MATLAB! Assuming that the center is defined as a point in Cartesian coordinates (X, Y, Z), you can add those values to the final x, y, z coordinates before plotting. Although it is easier to start with spherical coordinates, if you have Cartesian coordinates you can use the function cart2sph to convert them to spherical coordinates.
I was unsure if you wanted to plot a "slice" of the sphere that used the full range of the radius, the full range of phi, and the full range of theta, so I added the ability to select a smaller area to plot. Attached is my code to do so- hope this helps!
その他の回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Surface and Mesh Plots についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!