How to define a cone with an irregular basis
2 ビュー (過去 30 日間)
古いコメントを表示
Hi, I have a problem I really don't know how to solve. I have a series of point [X,Y] (with lengthX=lengthY=2000) that define a closed curve in the xy plan (z=0) and a point in a coordinate (x,y,z>0).
How can I define a volume or/and a surface from this two inputs? it must be a sort of cone that has for basis the curve and for vertex the single point?
And after that I have to use something like inpolygon in order to know if others points I will enter are or aren't inside this cone volume.
0 件のコメント
回答 (1 件)
Roger Stafford
2014 年 11 月 21 日
Using your X and Y for points along the curve and (x0,y0,z0) for the "cone" vertex coordinates (with z0>0,) let (x,y,z) be coordinates of some point for which we wish to determine whether it lies inside the cone or not.
in = inpolygon(z0/(z0-z)*(x-x0)+x0,z0/(z0-z)*(y-y0)+y0,X,Y) & z<z0 & z>=0;
will be true if (x,y,z) is inside the cone. (I am assuming the cone stops at the x,y plane. Otherwise remove the z>=0 condition.)
2 件のコメント
参考
カテゴリ
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!