フィルターのクリア

how to draw a plane?

2 ビュー (過去 30 日間)
bsd
bsd 2011 年 9 月 21 日
Hai,
I am working on optics. I have plotted a lens in matlab. The rays of light emerging out of the lens, after undergoing refraction in the lens, needs to be projected on a square plane in front of the lens. How is it possible to draw a plane in matlab? Looking forward to hearing from you soon.
BSD

採用された回答

Walter Roberson
Walter Roberson 2011 年 9 月 21 日
You can use patch() to draw a shape embedded in 3D.
  7 件のコメント
bsd
bsd 2011 年 9 月 24 日
http://www.opticasoftware.com/documentation/Rayica/PrinciplesOfRayica/4Customization/index.html#.1.2
go to the above link, and see the figure just immediately above the section 4.3. This is what I want to do using matlab, after the rays emerge out of the lens, and they hit an aperture in front of it, as seen in the above figure.
Walter Roberson
Walter Roberson 2011 年 9 月 24 日
Yup, you will be wanting non-zero z for that. The basic call will be as I gave above, patch([0 0 1 1 0], [0 1 1 0 0], [0 0 0 0 0]), but you will want different coordinates. The first parameter is a list of the x coordinates, the second parameter is a list of the corresponding y coordinates, and the third parameter is a list of the corresponding z coordinates.
You will also want to create a patch() for each of the apertures. You can use the usual sin() vs cos() coordinates if your square is perpendicular to one of the axes. For example,
sides = 17;
radius = 3;
angles = linspace(0,2*pi,sides+1) .';
coords = [radius * sin(angles), zeros(size(angles)), radius * cos(angles)];
xoff = 5; yoff = 2.8; zoff=3.3;
patch(xoff + coords(:,1), yoff + coords(:,2), zoff + coords(:,3));
and to draw the next circle, just change the xoff, yoff, zoff, and repeat the patch() command.

サインインしてコメントする。

その他の回答 (1 件)

Sean de Wolski
Sean de Wolski 2011 年 9 月 21 日
You could also use a surf or a slice
  1 件のコメント
Walter Roberson
Walter Roberson 2011 年 9 月 21 日
If your plane was along the z axis, then surf would not be able to handle it, as surf requires unique (x,y) for every z value.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeContour Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by