How i change cone direction and how i verify if a 3D point is inside of cone?
조회 수: 9 (최근 30일)
이전 댓글 표시
Hello! I have the follow cone code:
r = 112.0;
h = 100.0;
m = (h/r);
[R,A] = meshgrid(linspace(0,r,11),linspace(0,2*pi,41));
X = (R .* cos(A));
Y = (R .* sin(A));
Z = (m*R);
h=surf(X+185,Y+200,Z+210);
axis square
First of all, i don´t know if the cone was built correctly. I need create a cone with tip point in (x=185,y=200,z=210) but with a specific direction ( i need test to check what is the perfect), but i don't know how i change de direction (the normalized axis vector, pointing from the tip to the base).
Other thing is, how i check if a 3D point (with x,y and z coordinate) is inside or outside of cone?
Thanks for your attention
댓글 수: 0
답변 (1개)
yogesh jain
2016년 2월 20일
편집: yogesh jain
2016년 2월 20일
Hello , use 'rotate' function after 'surf', the created shape will be rotated according to plane , direction n specific points . follow this link - http://in.mathworks.com/help/matlab/ref/rotate.html
good luck
댓글 수: 0
참고 항목
카테고리
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!