How to define a cone with an irregular basis

조회 수: 2 (최근 30일)
matteo
matteo 2014년 11월 21일
편집: matteo 2014년 11월 21일
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.

답변 (1개)

Roger Stafford
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
matteo
matteo 2014년 11월 21일
hi thanks for your help but how can i plot all of this? Because I need to know if it's working. so I have to plot the cone and then the points.
matteo
matteo 2014년 11월 21일
편집: matteo 2014년 11월 21일
ps
my real problem is a little bit different, I have this 3d curve (X-Y-Z, I attached) and my point (the cone vertex) is
x0=3.838475517142584e+03
y0=-5.093829057940791e+03
z0=0

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by