How to make a 3D square pyramid with spheres?

jospercomp shared this question 2 years ago
Answered

How to make a 3D square pyramid with spheres with a slider?34df344529825bbd404824ba92545ca5

Comments (4)

photo
2

You asked a similar thing two weeks ago. The solution I posted had a slider for the number of levels.

Edit: Oh wait, those were triangular pyramids back then. Maybe I'll modify that to a 4-sided pyramid later. Or maybe you can figure out the proper formula yourself.

photo
1

MidPoints=Flatten(Sequence(Sequence(Sequence((2r k - r j, 2r m - r j, 2sqrt(2) / sqrt(3) r (n - 1 - j)), m, 0, j), k, 0, j), j, 0, n - 1))

Zip(Sphere(P, r), P, MidPoints)

photo
2

Almost. You adjusted the x and y coordinates, but not the z coordinate, so now the levels hang a bit in the air (i.e. the spheres of the higher level don't touch the ones in level below). Just change the "2sqrt(2)/sqrt(3)" in the z coordinate to only "sqrt(2)".

photo
1

MidPoints=Flatten(Sequence(Sequence(Sequence((2r k - r j, 2r m - r j, r + sqrt(2) / r (n - 1 - j)), m, 0, j), k, 0, j), j, 0, n - 1))

Zip(Sphere(P, r), P, MidPoints)

photo
© 2023 International GeoGebra Institute