graphing inplicit quadric equations

1 次查看(过去 30 天)
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

采纳的回答

Dishant Arora
Dishant Arora 2012-9-1
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);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Graphics Performance 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by