Plot of an ellipsoid
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Vikas Saroha
am 22 Aug. 2019
Bearbeitet: Bruno Luong
am 22 Aug. 2019
Hello, I want to plot ellipsoid at some points whose coordinates are known to us. I know the magnitude of three axis and their orientation in horizontal plane (i.e. angle w.r.t to X axis) as well as elevation (i.e. vertical angle ). How i can plot the ellipsoid, please suggest.
0 Kommentare
Akzeptierte Antwort
Johannes Fischer
am 22 Aug. 2019
This submission on the File Exchange comprises a 'drawEllipsoid' function which requires central point, length of half axes and Euler angles. You might need to convert your known angles to Euler angles.
0 Kommentare
Weitere Antworten (1)
Bruno Luong
am 22 Aug. 2019
Bearbeitet: Bruno Luong
am 22 Aug. 2019
% If your principal axis are (3x1) P1, P2, P3 and half length are (scalars) h1, h2, h3
Q = [P1(:), P2(:), P3(:)];
Q = Q .* ([h1, h2, h3]./sqrt(sum(Q.^2,1)));
n = 41;
[x,y,z]=sphere(n);
xyz = Q*[x(:) y(:) z(:)]';
x = reshape(xyz(1,:),[n n]+1);
y = reshape(xyz(2,:),[n n]+1);
z = reshape(xyz(3,:),[n n]+1);
surf(x,y,z,'linestyle','none');
axis equal
![ellipseoid.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/235015/ellipseoid.png)
0 Kommentare
Siehe auch
Kategorien
Mehr zu Vector Fields finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!