How to draw a prolate spheroid?

I have two points A(x1, y1, z1), B(x2, y2, z2), minor axis length(a) and major axis length(b). I need to draw a prolate spheroid with A and B as their focii points. This is what I have done till now.
C = (A + B )/2;
[x, y, z] = ellipsoid(C(1),C(2),C(3),b,a,a);
figure
surf(x, y, z)
I need help with rotating this ellipsoid such that the major-axis of the spheroid aligns with the line segment ACB. I am struggling with the angles of rotation and the order or rotation(which axis to rotate first).
Thank you.

Réponses (0)

Catégories

En savoir plus sur Fortran with MATLAB dans Centre d'aide et File Exchange

Produits

Version

R2017b

Question posée :

le 30 Mai 2018

Modifié(e) :

le 31 Mai 2018

Community Treasure Hunt

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

Start Hunting!

Translated by