Fitting a Tetrahedron into a Sphere
I'm not too sure if this would be the forum to ask this in but I've been bashing my head against a wall over this problem for the past 3 days.
Does anyone know of a method of computing the 4 vertices needed for the tetrahedron so that these vertices lie on a unit sphere? I've been attempting to code a 3-d version of the koch snowflake, but have ran into a small snag on this part. I'm pretty sure the rest of my algorithm works, I just need to figure out how to get these first 4 points.
Any help at all would be greatly appreciated.
Sounds like you already have a tetrahedron, just not 'unit-sphereized'? If so just normalize your verts -> instant unit sphere.
what you need to do is put two vertices on two peripendicular axis each, spaced a certain amount along the third axis.
can you picture that? in code it would be something like this:
the keyis finding a and b.
we know that a*a+b*b should be 1
also, all edgelengths should be equal, so 4*a*a = 2*a*a + 4*b*b
two equations, two unknown, yay. maybe there slipped an error in the last equation, but you get the idea.
can you picture that? in code it would be something like this:
addvertex( a, 0, b);addvertex(-a, 0, b);addvertex( 0, a,-b);addvertex( 0,-a,-b);
the keyis finding a and b.
we know that a*a+b*b should be 1
also, all edgelengths should be equal, so 4*a*a = 2*a*a + 4*b*b
two equations, two unknown, yay. maybe there slipped an error in the last equation, but you get the idea.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement