How to create a sphere filled with equidistant points inside it?
6 views (last 30 days)
Show older comments
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.
0 Comments
Answers (1)
Walter Roberson
on 9 Oct 2021
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
See Also
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!