How do I plot a sphere along an elliptical path
Ältere Kommentare anzeigen
Hi all,
I am trying to plot a spherical object along an elliptical path, I found this code that plots the path, but I need to get the sphere to move along this path
ellipse = fncmb(circle,[2 0;0 1]);
s45 = 1/sqrt(2);
rtellipse = fncmb(fncmb(ellipse, [s45 -s45;s45 s45]), [1;1] );
hold on, fnplt(rtellipse), hold off
Regards,
Jobe
4 Kommentare
Walter Roberson
am 4 Dez. 2013
Is this intended to be about the same matter as http://www.mathworks.co.uk/matlabcentral/answers/108526-how-to-animate-the-motion-of-a-spherical-object-in-a-circular-path ?
Mahmoud
am 4 Dez. 2013
Bearbeitet: Walter Roberson
am 4 Dez. 2013
Walter Roberson
am 4 Dez. 2013
The code you show doesn't really rotate the sphere: it rotates the viewpoint leaving the sphere fixed in place. My guess is that you will want to keep your viewpoint in place and have the object move within the fixed view, right?
Mahmoud
am 4 Dez. 2013
Akzeptierte Antwort
Weitere Antworten (1)
Mahmoud
am 4 Dez. 2013
Bearbeitet: Walter Roberson
am 4 Dez. 2013
1 Kommentar
Walter Roberson
am 4 Dez. 2013
You probably don't want the scaling portion going on, just
Rz = makehgtform('zrotate',r);
set(t, 'Matrix', Rz);
drawnow()
I am not sure at the moment why the rotation might not be happening. Are you seeing the scaling going on? With the code you have, is the sphere growing over time?
Kategorien
Mehr zu Surface and Mesh Plots finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!