Intersection curves of ellipsoid and sphere - problems computing intersection!

6 views (last 30 days)
Hello,
I am failing since two days to compute and to plot the intersection of an ellipsoid in parametric notation
function erg = ellip(x,y,z)
erg = (x/8)^2+(y/2)^2+z^2-1;
and a sphere
function erg = sphere(x,y,z)
erg(1)=(x-2)^2+y^2+(z-1)^2-16;
erg=erg';
I failed completely at even plotting them without the help of some download function ezimplot3.
Does anyone know of any resource that actually teaches the reader how to work with parametric representations and MATLAB ? I did this by hand, on paper, only to panic in front of the keyboard again.
The possible ideas I came up with: (sphere and ellipsoid are placeholders, didnt want to wrtie too much code)
1. curve=solve(sphere==ellipsoid), ezplot(curve)
--> Problems: two parallel intersections, failure while plotting...
2. function MINIM = sphere-ellipsoid(coords), fzero(MINIM)
--> how do I plot that then ?
I would be very happy if someone could help me with this,
I know that a very elegant solution exists (this was my exam from 20 minutes ago) and that no functions need to be downloaded. Clarification: | The exam is over! I mean, it's just 90 mins. |
A. I am prepared for it being very obvious.
B. I would like specific syntax when it involves function handles- i had to do almost everything using symbolic toolbox as calls using handles always crapped out and I do not know why.

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!