Hello everyone, i'm new to the forums and also to math apparently, because i'm stuck with a problem that i can't seem to figure out.
What i need to do is take an arbitrary vector position on the surface of a sphere of 1 unit radius, and project that point onto the surface of a cube that envelops the sphere and is tangent to it, of 2x2 unit each side. (That makes the inside of the cube touch the outside of the sphere)
I found an equation that lets you take a point on a circle and project it to a square, and it works just fine:
x = ½ √( 2 + u² - v² + 2u√2 ) - ½ √( 2 + u² - v² - 2u√2 )
y = ½ √( 2 - u² + v² + 2v√2 ) - ½ √( 2 - u² + v² - 2v√2 )
However, it is 2D, and i need it to be 3D, but i don't really know how to make it 3D.
Can anyone help me to make it 3D, or may have another solution that is entirely different or simpler? I'd be much appreciated.
What i need to do is take an arbitrary vector position on the surface of a sphere of 1 unit radius, and project that point onto the surface of a cube that envelops the sphere and is tangent to it, of 2x2 unit each side. (That makes the inside of the cube touch the outside of the sphere)
I found an equation that lets you take a point on a circle and project it to a square, and it works just fine:
x = ½ √( 2 + u² - v² + 2u√2 ) - ½ √( 2 + u² - v² - 2u√2 )
y = ½ √( 2 - u² + v² + 2v√2 ) - ½ √( 2 - u² + v² - 2v√2 )
However, it is 2D, and i need it to be 3D, but i don't really know how to make it 3D.
Can anyone help me to make it 3D, or may have another solution that is entirely different or simpler? I'd be much appreciated.