graphing inplicit quadric equations

2 vues (au cours des 30 derniers jours)
SonOfAFather
SonOfAFather le 31 Août 2012
I am trying to graph five different quadric surfaces and don't know the name of them. the idea is to see the shame and name them. that being said is there a keyword in matlab that allows the input of a equation and the output is a graph of the 3d surface. I know that I can use plot3(x,y,z,) but this is not really helpful when I can't input the equation as it is given.
the one of the equations is as follows:
y^2=z^2-x^2+1

Réponse acceptée

Dishant Arora
Dishant Arora le 1 Sep 2012
It would'v been a lot easier if we were able to express the function explicitly, but since it cant be expressed explicitly, we must parameterize it and in this case parameterization takes the following form
x=sqrt(1+z^2)*cos(phi)
y=sqrt(1+z^2)*sin(phi)
once you are done with parameterization, you can plot it like shown below:
[phi, Z] = meshgrid((0:0.1:2)*pi, (-2:0.1:2));
X=sqrt(1+Z.^2).*cos(phi);
Y=sqrt(1+Z.^2).*sin(phi);
surf(X, Y, Z);

Plus de réponses (0)

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by