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

2 visualizaciones (últimos 30 días)
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

Respuesta aceptada

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

Más respuestas (0)

Categorías

Más información sobre Surface and Mesh Plots en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by