• Welcome to the new Internet Infidels Discussion Board, formerly Talk Freethought.

The Math Thread

The distance to which part of the tetrahedron? Faces, edges, vertices?
Well... everywhere. :D

How about just the distance from the origin, to an equilateral triangle that is orthogonal to the x-axis, pointed up (y is up for me...). Then a rotation matrix to reach one of the other faces. I'll figure it out from there.

It's for art man. Art! Unless you think easy transforms between Platonic solids are something that can be used for nefarious purposes.

Well, fine then. :p


Suppose the side length is \(s\). The Pythagorean theorem shows that the circumsphere radius is \(R = \sqrt{\frac{3}{8}}s\) and the insphere radius is \(r = \sqrt{\frac{2}{3}}s - \sqrt{\frac{3}{8}}s = \frac{1}{\sqrt{24}}s\). These are the shortest distances from the center to a vertex and a face respectively. If you want the midsphere radius, you get \(r_m = \frac{1}{\sqrt{8}}s\), which is the shortest distance to an edge.


If you want coordinates, it's often easiest to take the tetrahedron inscribed in the cube. Take 4 non-adjacent cube vertices, say (1, 1, 1), (1, 0, 0), (0, 1, 0) and (0, 0, 1). They form the vertices of a regular tetrahedron with side length \(\sqrt{2}\). Convex combinations of the vertices give arbitrary points in and on the tetrahedron, where the number of zero coefficients determines whether the point is interior, on a face, an edge, or a vertex.
 
While we can easily convert from a sphere to a cube, then to a tetrahedron, do manipulations on the object that has been tetrahedronized, convert back to a cube, then to a sphere (I've already done the sphere to cube, cube to sphere math, works beautifully), I'd like to go directly from tetrahedron to sphere and back.

It was a bit easier with a cube- each face is tangent to an axis in the coordinate system I used. In the tetrahedral transform case it is a bit more complicated... basically, looking to do something similar to below:

Code:
// any sized cube with faces on the x,y,z axes to insphere:
Tyz= y^2/z^2;
if Tyz>1 Tyz=1/Tyz;
Tyz= sqrt(Tyz+1);   // more or less 1/cos(atan(y/z)) if |z|>|y| or 1/sin(atan(y/z)) if it isn't >

Txyz= (y^2+z^2)/(x^2);
if Txyz>1 Txyz=1/Txyz;
Txyz=sqrt(Txyz+1);      // same as above... 

x'= x * Txyz / sqrt(3/2);   // sqrt(3/2)...  for whatever reason.. I thought the 
y'= y * Txyz * Txy /sqrt(3/2);   // insphere looked smaller than the insphere
z'= z * Txyz * Txy / sqrt(3/2);   // maybe unnecessary...

I'd like to get all the platonic to sphere, sphere to platonic transforms on the net so they are readily available.
 
Last edited:
While we can easily convert from a sphere to a cube, then to a tetrahedron, do manipulations on the object that has been tetrahedronized, convert back to a cube, then to a sphere (I've already done the sphere to cube, cube to sphere math, works beautifully), I'd like to go directly from tetrahedron to sphere and back.

It was a bit easier with a cube- each face is tangent to an axis in the coordinate system I used. In the tetrahedral transform case it is a bit more complicated... basically, looking to do something similar to below:

Code:
// any sized cube with faces on the x,y,z axes to insphere:
Tyz= y^2/z^2;
if Tyz>1 Tyz=1/Tyz;
Tyz= sqrt(Tyz+1);   // more or less 1/cos(atan(y/z)) if |z|>|y| or 1/sin(atan(y/z)) if it isn't >

Txyz= (y^2+z^2)/(x^2);
if Txyz>1 Txyz=1/Txyz;
Txyz=sqrt(Txyz+1);      // same as above... 

x'= x * Txyz / sqrt(3/2);   // sqrt(3/2)...  for whatever reason.. I thought the 
y'= y * Txyz * Txy /sqrt(3/2);   // insphere looked smaller than the insphere
z'= z * Txyz * Txy / sqrt(3/2);   // maybe unnecessary...

I'd like to get all the platonic to sphere, sphere to platonic transforms on the net so they are readily available.

To go from any convex solid to the sphere, you just need to normalize the vector and scale appropriately (assuming center at 0).

To go from a sphere to a solid, you want the  Gnomonic projection. Choose appropriate vertex points on the sphere and then project onto the tangent plane for each face. If a face tangency has polar angle \(\theta_0\), the scale for points on that face is \(1/cos(\theta - \theta_0)\)
 
Well... I've got the cube done. I didn't want to have to figure out everything for the tetrahedron or the other solids if the work was already done.

I figured maybe someone knew the stuff or could tell me where the equations were on the net so I didn't have to do all the work, since Googling "tetrahedron to sphere transform" or "Platonic solid to sphere transform" doesn't give me any decent links.

It's for a good cause:
holesphere.jpeg
 
Well... I've got the cube done. I didn't want to have to figure out everything for the tetrahedron or the other solids if the work was already done.

I figured maybe someone knew the stuff or could tell me where the equations were on the net so I didn't have to do all the work, since Googling "tetrahedron to sphere transform" or "Platonic solid to sphere transform" doesn't give me any decent links.

It's for a good cause:
View attachment 4640

You're basically asking for a polyhedral map projection. It's almost certainly been done before, pretty much necessarily defined piece-wise and it almost certainly isn't pretty.

Here's the output for someone's:
download.jpg

http://www.win.tue.nl/~vanwijk/myriahedral/CAJ103.pdf
http://kidbots.com/WEBADD/BUCKMINSTER_FULLER_TYPE_MAPS/MAPS_THAT_FOLD/projPoly.html
 
I was reading about map projections before you mentioned Gnomonic projection... still, no easy formulas to use. Plenty of ways to use software that manipulates vertices... but nothing for pure scalar transforms like I want.

Yeah... I was having problems making a single face!!!.. and then I looked at my damn code. One little tiny thing, that if I had a second pair of smart eyes, they would have spotted it. I was trying all sorts of illogical things because the right way didn't work!!@$!@$!@$

Anyway, it was extremely simple, and now all I have to do is flatten the one part (an inverse transform of a portion of the spherical transform from a cube), and scale along the x axis (which the equilateral triangle part is orthogonal to).


Ok.. So now the real problem. I'll pass you the code, but I'd like to do the same thing with a stellated octahedron. You have any smart grad students?

For what I'm doing, I can't just flip it on the x axis, rotate it by pi/6, and shift it along the x axis, which I could do if I was using any of the thousands of vertex based transforms I've seen on the web.... Am I the only one doing it the right (smooth!) way?
 
I was reading about map projections before you mentioned Gnomonic projection... still, no easy formulas to use. Plenty of ways to use software that manipulates vertices... but nothing for pure scalar transforms like I want.

Yeah... I was having problems making a single face!!!.. and then I looked at my damn code. One little tiny thing, that if I had a second pair of smart eyes, they would have spotted it. I was trying all sorts of illogical things because the right way didn't work!!@$!@$!@$

Anyway, it was extremely simple, and now all I have to do is flatten the one part (an inverse transform of a portion of the spherical transform from a cube), and scale along the x axis (which the equilateral triangle part is orthogonal to).

Ok.. So now the real problem. I'll pass you the code, but I'd like to do the same thing with a stellated octahedron. You have any smart grad students?

If you can do the cube (or the octahedron - yay duality!), then the stellated octahedron shouldn't be too much harder. You'd go sphere -> cube and then decompose each cube face to do an appropriate projection onto the final faces of the stellated octahedron.

For what I'm doing, I can't just flip it on the x axis, rotate it by pi/6, and shift it along the x axis, which I could do if I was using any of the thousands of vertex based transforms I've seen on the web.... Am I the only one doing it the right (smooth!) way?

Generally, when everyone takes a shortcut it's because the long way sucks. :p
 
Ooh, I just got the news. According to the seminar schedule at the University of Chicago, Babai is giving a talk on a new proof that the  graph isomorphism problem is solvable in  quasi-polynomial time. This is a big deal, and is blowing up the interwebs - inasmuch as an abstruse complexity-theoretic result can be said to blow up anything.

Anyway, now you can say you heard about it before the first wiki edits. Congratulations. :D
 
I was reading about map projections before you mentioned Gnomonic projection... still, no easy formulas to use. Plenty of ways to use software that manipulates vertices... but nothing for pure scalar transforms like I want.
What would a "pure scalar transform" look like?
 
I was reading about map projections before you mentioned Gnomonic projection... still, no easy formulas to use. Plenty of ways to use software that manipulates vertices... but nothing for pure scalar transforms like I want.
What would a "pure scalar transform" look like?

A pure scalar robot, in disguise.

Obviously.
 
Kharakov, I don't know of any sphere-to-plane transforms that have that form. Why do you want that form?

There's a further difficulty with sphere-to-plane transforms -- you have to go from a 3-vector to a 2-vector.

I'd thought of listing some sphere-to-plane transforms, but I don't know who might be interested. One will need trig, log, and exp functions for them, but one won't need calculus except for verifying some of their properties.
 
I might be interested- I'm interested in any ideas or suggestions you have. I'm hoping to learn a few more coordinate system transformations at the moment. Even the basic stuff might be useful (maybe..) in the future- these are various transforms applied to coordinate systems before calculating a Menger.
triangle.jpeg
cylinder.jpeg
holespherewithunsphere.jpeg
holesphere.jpeg


The transforms can be used in conjunction with formulas, calculating in a different coordinate system, then switching back to the original coordinate system after applying a specific transform. The following are a few basic formulas combined with sphere to cube, and cube to sphere coordinate system transforms...

mengerballs.jpegsquaresss.jpgsquare%u0025252520big2.jpg
 

Attachments

  • holesphere.jpeg
    holesphere.jpeg
    33.9 KB · Views: 2
  • cylinder.jpeg
    cylinder.jpeg
    8.6 KB · Views: 2
  • triangle.jpeg
    triangle.jpeg
    15.4 KB · Views: 2
  • square%u0025252520big2.jpg
    square%u0025252520big2.jpg
    27.7 KB · Views: 3
How about a 3 dimensional analog of the 2d circle to polygon transform??

theta=atan2(y,x)

while (theta>pi/sides) theta-=2.*pi/sides;
while (theta<-pi/sides) theta+=2.*pi/sides;


x'=x cos(theta); y'=y cos(theta);
 
That analog in 3D is essentially gnomonic projection.

In 2D, you could also just do Schwarz-Christoffel, but I am unaware of any extension of that to higher dimension - it may be that conformality is no longer possible.
 
I'll do some azimuthal or polar-coordinate sphere-to-plane projections here, since they are fairly simple.

Coordinates on the sphere:
Polar angle θ -- colatitude = 90d - latitude
Azimuthal angle φ -- longitude

Coordinates on the plane:
\( x = r \cos \phi \)
\( y = r \sin \phi \)
where the transform is r = r(θ)

The sphere's coordinate north pole (θ = 0, φ = indeterminate) goes the plane's origin (x = 0, y = 0), and the transform is continuous around those points. This means that r -> θ as θ -> 0.

The position in the sphere as a vector is \( X = \sin \theta \cos \phi ,\ Y = \sin \theta \sin \phi ,\ Z = \cos \theta \)

One can express the plane coordinates with scaling factor S as
\( x = S X ,\ y = S Y ,\ r = S \sqrt{X^2 + Y^2} \)

Gnomonic projection: geodesic -> geodesic (great circle -> line)
\( r = \tan \theta \)
\( S = \frac{1}{Z} \)

Stereographic projection: conformal (equal angles, equal shapes)
\( r = 2 \tan (\theta/2) \)
\( S = \frac{2}{1 + Z} \)

Lambert azimuthal equal-area projection:
\( r = 2 \sin (\theta/2) \)
\( S = \sqrt{\frac{2}{1 + Z}} \)

Orthographic projection: view from distance
\( r = \sin \theta \)
\( S = 1 \)

Azimuthal equidistant (United Nations projection)
\( r = \theta \)
\( S = \frac{\arcsin (\sqrt{X^2 + Y^2})}{\sqrt{X^2 + Y^2} \)

Wikipedia has  List of map projections
 
Ohh, so I ended up doing this again, around z vs. xy, and it worked:

How about a 3 dimensional analog of the 2d circle to polygon transform??
theta=atan2(y,x)
while (theta>pi/sides) theta-=2.*pi/sides;
while (theta<-pi/sides) theta+=2.*pi/sides;
x'=x cos(theta); y'=y cos(theta);

I was doing the transforms in the wrong order. I didn't even think to check my programming- this happened to me a week ago with the sphere to cube transform... I hope this sinks in. 2 times in a week (well, 6, if you count the fdivp/fdivrp things I did too...) Sooo... still, I only have 2 of the Platonic solids doing it this way, and I still am looking for easy solutions for the regular and stellated octahedron.

Ohh, so the 3 dimensional analogue is... well...
This:
theta=atan2(y,x)

while (theta>pi/sides1) theta-=2.*pi/sides1;
while (theta<-pi/sides1) theta+=2.*pi/sides1;
x'=x cos(theta); y'=y cos(theta);

Followed by (I was doing this first.... which resulted in mehhh):

phi=atan2(z,sqrt(x^2+y^2))

while (phi>pi/sides) phi-=2.*pi/sides;
while (phi<-pi/sides) phi+=2.*pi/sides;

x'=x cos(phi); y'=y cos(phi); z'= z cos(phi)


So... some of it is solved. Stellated and regular octahedra would be nice... if someone would point me in the right direction. ;)
 
I'm wondering, since I can't tell visually, if it is correct to scale the z component of the above transform (for a tetrahedron) by sqrt(2) to make the tetrahedron regular?

The square base pyramid (5 sides total) is scaled correctly.
 
I had some fun with combinatorics today. I was counting the number of distinct colorings of an n by n grid of squares. Each square can be colored either black or white, and we consider boards the same that can be transformed to each other via (any combination of) rotations, reflections, and reversing the colors.

I get \(\frac{1}{16}\left(2^{n^2} + 4\cdot 2^{\frac{n^2}{4}} + 6 \cdot 2^{\frac{n^2}{2}} + 2 \cdot 2^{\frac{n(n+1)}{2}}\right)\) colorings if n is even and \(\frac{1}{16}\left(2^{n^2} + 2\cdot 2^{\frac{n^2+3}{4}} + 2^{\frac{n^2+1}{2}} + 4\cdot 2^{\frac{n(n+1)}{2}}\right)\) if n is odd.
 
I had some fun with combinatorics today. I was counting the number of distinct colorings of an n by n grid of squares. Each square can be colored either black or white, and we consider boards the same that can be transformed to each other via (any combination of) rotations, reflections, and reversing the colors.

I get \(\frac{1}{16}\left(2^{n^2} + 4\cdot 2^{\frac{n^2}{4}} + 6 \cdot 2^{\frac{n^2}{2}} + 2 \cdot 2^{\frac{n(n+1)}{2}}\right)\) colorings if n is even and \(\frac{1}{16}\left(2^{n^2} + 2\cdot 2^{\frac{n^2+3}{4}} + 2^{\frac{n^2+1}{2}} + 4\cdot 2^{\frac{n(n+1)}{2}}\right)\) if n is odd.

I don't get it. Maybe missing a floor function or something? Maybe I mistyped? ..

hehehe... mistyped. instead of 2^(n^2) I had 2* n^2 for the first term in each one. NM...

It's on OEIS as well.
 
Last edited:
Back
Top Bottom