# convert image pixel dimensions to UV

Hi i am rather new to computergraphics but i am trying to map an equirectangular image (360 video) to the inside of a sphere now i found the following formula to do this.

phi = 2*Pi*u
cos(theta) = 2*v -1


But how do i get u and v ? In the article he talks about this:

So we can just project the sphere points in the xy plane onto the unit radius cylinder and unwrap it! If we have such an image with texture coordinates (u,v) in [0,1]^2

But how do i get those texture coordinates from and image with lets say the following dimensions 4096x2048 pixels?

Sorry if this is a bit vague, i am trying to understand it myself. If clarification is needed i am happy to edit my question!

$$u = 4095 / 4096 = 0.99976$$ $$v = 2047 / 2048 = 0.99951$$
$$u = 2047 / 4096 = 0.49975$$ $$v = 1023 / 2048 = 0.49951$$