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

2 Ansichten (letzte 30 Tage)
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

Akzeptierte Antwort

David Goodmanson
David Goodmanson am 28 Jul. 2019
Bearbeitet: David Goodmanson am 28 Jul. 2019
Hi adam,
two lines become
y(m)=R*sind(n+45);
x(m)=R*cosd(n+45);

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by