how to draw a tilted circle?
Mostrar comentarios más antiguos
Hai,
The following code draws a circle in the x-z plane in 3D.
radius=1;
center=[2 4 2];
theta=linspace(0,2*pi);
rho=ones(1,100).*radius;
[x,z]=pol2cart(theta,rho);
x=x+center(1);
z=z+center(3);
y=center(2)*ones(1,length(x));
figure;
h=plot3(x,y,z);
grid on;
axis square;
By default the above circle is vertical in the x-z plane. I need to draw a circle which is inclined or tilted at some angle. How could I do this?
Looking forward for your reply.
BSD
1 comentario
Walter Roberson
el 3 de Oct. de 2011
Duplicate is at http://www.mathworks.com/matlabcentral/answers/17160-how-to-draw-an-inclined-circle
Respuesta aceptada
Más respuestas (1)
Walter Roberson
el 3 de Oct. de 2011
0 votos
The answer hasn't changed since your previous time asking.
If you wish to do it mathematically instead of the way I suggested before, then say as much (at which point I would say, "So, did you read the documentation to find out what that routine actually does ?")
1 comentario
Jan
el 3 de Oct. de 2011
@Walter: Your answer has been complete. I add more details only, because it seems that the OP cannot follow completely.
Categorías
Más información sobre 2-D and 3-D Plots en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!