I need to tile a unit sphere with N equal equilateral spherical triangles and get an array of the coordinates {Phi, Theta} of the centroids of those triangles. What is the most straightforward way to do this in Mathematica? Are there any built-in functions that might help?

  • 2
    $\begingroup$ It is mathematically impossible to tile a sphere with an arbitrary $N$ equilateral spherical triangles. $\endgroup$ Dec 17, 2018 at 17:02
  • $\begingroup$ Ok, that is not the most crucial part. What about tiling with just N triangles? $\endgroup$
    – user15933
    Dec 17, 2018 at 17:12
  • $\begingroup$ What version of Mathematica are you using? $\endgroup$
    – halirutan
    Dec 17, 2018 at 17:19
  • $\begingroup$ Mathematica 11.3 $\endgroup$
    – user15933
    Dec 17, 2018 at 17:22
  • 1
    $\begingroup$ @DavidG.Stork This is why I have written: "subdivide". I wasn't sure if the OP wants a tiling of the sphere's surface, a subdivision of the 3D sphere for e.g. FEM, or a mesh using triangles that approximates the surface of the sphere. $\endgroup$
    – halirutan
    Dec 18, 2018 at 0:00

2 Answers 2


I'm still not sure I understood what you are seeking, but let's give it a try. Let us look at a simple function that subdivides a triangle in the following way:

div[expr_] := expr /. Triangle[pts : {a_, b_, c_}] :> 
  With[{ab = Mean[{a, b}], ac = Mean[{a, c}], bc = Mean[{b, c}]},
    Triangle /@ {{a, ab, ac}, {ab, b, bc}, {ab, bc, ac}, {ac, bc, c}}

tri = Triangle@Table[{Cos[phi], Sin[phi]}, {phi, {0, 2 Pi/3, 4 Pi/3}}];
 Graphics[{FaceForm[None], EdgeForm[Gray], #}] & /@ {tri, div[tri]}]

Mathematica graphics

Now, let us take a look at an Icosahedron

Mathematica graphics

We can access the triangles of this polyhedron using PolyhedronData as well. There might be an easier way to do this, but I'm not digging right now:

pts = Triangle[N@PolyhedronData["Icosahedron", "Vertices"][[#]]] & /@ 
   PolyhedronData["Icosahedron", "Faces"];

Now, we can use the div function to subdivide each of the triangles as often as we want

subpts = Nest[div, pts, 2];

Mathematica graphics

The last step is the most important one: Now we take each vertex and normalize is. This means in 3D it will be projected onto the surface of the unit sphere

Graphics3D[subpts /. Triangle[pts_] :> Triangle[Normalize /@ pts]]

Mathematica graphics

If you want a finer mesh, just use 3, 4 or 5 subdivisions.


Discretize the unit sphere into triangles with DiscretizeRegion[Sphere[]], using the MaxCellMeasure or MeshQualityGoal options to choose the grid quality, and then calculate the centers of the resulting triangles (mesh primitives are all triangles in this case):

MeshPrimitives[DiscretizeRegion[Sphere[]], 2] /. Polygon[L_] :> Normalize[Mean[L]]

{{0.222616, -0.858449, 0.462068}, {0.166477, -0.863634, 0.475837}, ..., {0.425092, 0.502648, 0.752757}, {0.451631, 0.406594, 0.794173}}

This is what the sphere discretization looks like with default parameters:


enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.