フィルターのクリア

How to create a sphere filled with equidistant points inside it?

6 ビュー (過去 30 日間)
Rushil Asthana
Rushil Asthana 2021 年 10 月 9 日
コメント済み: Rushil Asthana 2021 年 10 月 10 日
I want to create a sphere with equidistant points inside it. The sphere should be placed essentially in a matrix, so that the sphere can be detected. Wherever there is a sphere.. the code should output 1 and viceversa.

回答 (1 件)

Walter Roberson
Walter Roberson 2021 年 10 月 9 日
xc = 10; yc = 15; zc = 12; R = 8;
[X, Y, Z] = meshgrid(linspace(0,20,100));
M = double((X-xc).^2 + (Y-yc).^2 + (Z-zc).^2 <= R.^2);
isosurface(X, Y, Z, M, 0)
axis equal
  1 件のコメント
Rushil Asthana
Rushil Asthana 2021 年 10 月 10 日
Hey, thanks bro. But this is not exactly what i want. The sphere should be filled with equidistant inside it not on the surface. Could you please help me in this?

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

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by