How to rotate the plot attached(Truncated Pyramid) to make its sides parallel to its Axis.

조회 수: 2 (최근 30일)
clear
clc
dh=0.5; %step depth used
a=45; %angle of inclination of the pyrmid
h=30; %Depth of the pyramid
L=100; W=100;
X=L/2; Y=W/2;
R1=sqrt(X^2+Y^2); %diagonal(top part of the Pyramid)
N=h/dh; %Number of loops or contour
m=1;
for n=0:90:360*N %dividing one contour into 360 angles
z(m)=-((dh/360)*n);
R=R1-(((dh/360)*n)/tand(a)); %diagonal at any intermediate depth
y(m)=R*sind(n);
x(m)=R*cosd(n);
m=m+1;
end
plot3(x,y,z,'b') % 3D visualization of helix

채택된 답변

David Goodmanson
David Goodmanson 2019년 7월 28일
편집: David Goodmanson 2019년 7월 28일
Hi adam,
two lines become
y(m)=R*sind(n+45);
x(m)=R*cosd(n+45);

추가 답변 (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