how to convert to 3d?

Hai,
I have plotted a hyperbolic lens in matlab using the equation "y=sqrt((n^2-1)*((x-f)^2))+((2)*(f)*(n-1)*(x-f)))". As you can see the equation is in 2d, but I need the lens in 3d, is it possible in matlab? Do you have any equations for lens in 3d?
BSD

4 comentarios

Image Analyst
Image Analyst el 23 de Sept. de 2011
What is the other dimension? Assuming n is a constant (index of refraction) and f is a constant (focal length) then y is a function of only x, not x and something else. That is a 1D situation. So what is your second dimension you want to plot? Do you want to plot y as you also change n or f?
bsd
bsd el 23 de Sept. de 2011
I don't have any second dimension, I need to view the lens in 3d, in the form of an hyperboloid.
BSD
Image Analyst
Image Analyst el 23 de Sept. de 2011
Maybe if you say x is really r (radius) and so then you have x and y and then the equation would be z. Then you would have a 2D situation. You could then use meshgrid() and surf(). Can you try that and get back to us?
bsd
bsd el 24 de Sept. de 2011
I did not understand your explanation...
BSD

Iniciar sesión para comentar.

 Respuesta aceptada

Fangjun Jiang
Fangjun Jiang el 23 de Sept. de 2011

0 votos

It's probably not "convert". If you don't have the third dimension, then it is a 2d plot. If you want to view it in 3d, you can use view().
plot(magic(10));
view(3)
Then, click the "rotate 3D" button to rotate and see the effect.

3 comentarios

Fangjun Jiang
Fangjun Jiang el 23 de Sept. de 2011
Oh, good, I guessed right! BTW, is your other question "How to rotate" along the same line? You can use view() with different input arguments to rotate the view, as if you use the "rotate 3D" button.
bsd
bsd el 23 de Sept. de 2011
what is BTW?
BSD
Fangjun Jiang
Fangjun Jiang el 23 de Sept. de 2011
By the way, according to http://en.wikipedia.org/wiki/BTW.

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Preguntada:

bsd
el 23 de Sept. de 2011

Community Treasure Hunt

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

Start Hunting!

Translated by