Look at particle on the x-y plane instead of 3-D

2 ビュー (過去 30 日間)
Phong Pham
Phong Pham 2015 年 11 月 24 日
コメント済み: Walter Roberson 2015 年 12 月 18 日
Hi anyone,
I have a cubic box with 512 spherical particles in three-dimensional space. The particles are random distributed in the box as knowing the x,y,z positions as well as the radius of particle (radius is the same for every spherical particle). Now, I want to look at particles on x-y plane only (z=0) instead in 3-D. is there any function to do that in matlab such as slice. I have read slice function but I still do not understand how it works. If anybody is similar with the problem, then please help me.
Thanks

採用された回答

Walter Roberson
Walter Roberson 2015 年 11 月 25 日
It sounds as if you have a list of (x,y,z) triples instead of an 8 x 8 x 8 cube of points. You will therefore need to identify the points of interest. I will assume for this purpose that you consider points to be on the z plane if their sphere crosses the z plane.
zmask = (z >= -R & z <= R);
x0 = x(zmask);
y0 = y(zmask);
z0 = z(zmask);
Now you need to draw a bunch of circles, but the radius of each will depend upon how close the z coordinate is to 0.
r0 = sqrt(R^2 - z0.^2);
and now you can viscircles() with x0, y0, r0
  2 件のコメント
Phong Pham
Phong Pham 2015 年 12 月 18 日
編集済み: Walter Roberson 2015 年 12 月 18 日
Thanks for your answer, Walter.
What if I now look at Z=R instead of 0.
zmask = (z >= R & z <= 2R);
x0 = x(mask);
y0 = y(mask);
z0 = z(mask);
r0 = sqrt(R^2 - z0.^2);
is the r0 equation still right? I don't think it is because r0 is now imaginary number because it is far down. Is r0 = sqrt(R^2 - (z0-R).^2)? Thanks.
Walter Roberson
Walter Roberson 2015 年 12 月 18 日
For points crossing z = L then
zmask = (z >= (L-R) & z <= (L+R));
x0 = x(mask);
y0 = y(mask);
z0 = z(mask);
r0 = sqrt(R^2 - (z0-L).^2);

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by