How to rotate the plot attached(Truncated Pyramid) to make its sides parallel to its Axis.
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
adam adam
le 27 Juil 2019
Commenté : adam adam
le 28 Juil 2019
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 commentaires
Réponse acceptée
David Goodmanson
le 28 Juil 2019
Modifié(e) : David Goodmanson
le 28 Juil 2019
Hi adam,
two lines become
y(m)=R*sind(n+45);
x(m)=R*cosd(n+45);
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Surface and Mesh Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!