How to rotate the plot attached(Truncated Pyramid) to make its sides parallel to its Axis.
2 views (last 30 days)
Show older comments
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
0 Comments
Accepted Answer
David Goodmanson
on 28 Jul 2019
Edited: David Goodmanson
on 28 Jul 2019
Hi adam,
two lines become
y(m)=R*sind(n+45);
x(m)=R*cosd(n+45);
More Answers (0)
See Also
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!