Circumference and cone in plot3
显示 更早的评论
Hello everyone!
How I represent a circumference in a figure of Plot3? (i have the coordinates x,y and z of center and radius).
By the way...how i represent a cone beginning in center of circumference (x,y,z of center)?
Thanks!!
回答(1 个)
Star Strider
2015-5-9
5 个评论
Nuno
2015-5-9
Star Strider
2015-5-9
If that is what you want, then it’s correct. It plots the circumference of a circle on an inclined plane.
The cone is easy:
% CONE USING ‘plot3’
z = linspace(0, 100, 1000);
x = z.*cos(z*pi);
y = z.*sin(z*pi);
figure(1)
plot3(x, y, z)
grid on
axis equal
Nuno
2015-5-9
Nuno
2015-5-9
Star Strider
2015-5-9
I am not sure what you want to do. You are of course free to experiment by changing the linspace parameters as you wish. If you want to shift the apex of the cone from (0,0), add those values to ‘x’ and ‘y’.
So to shift it to (10,10), do this:
z = linspace(0, 100, 1000);
x = z.*cos(z*pi)+10;
y = z.*sin(z*pi)+10;
figure(1)
plot3(x, y, z)
grid on
axis equal
类别
在 帮助中心 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!