# Reprojecting/converting an orthographic image/grid into a cartesian grid

I'm trying to dewarp a fisheye image into a simple rectilinear image of a subset of the fisheye. As part of this, I'm trying to map the azimuth/altitude values into a point on the image.

The points around each meridian line are equidistant so I can't use a squashed circle and simple angles from the centre point won't fit. The two axis are also linear (in this projection)

Using the law of cosines, I can calculate the radial angle out from the optical axis, but I can't figure out how to calculate the angle around the axis.

How can I convert from the azimuth/altitude values (e.g. -40,40) to a pixel location (e.g. 190,157)?

I've found some similar questions but I'm not sure they're the same and I don't understand the answers :)

-
I've figured out the radial angle from the optical axis, but still trying to figure out the angle around the axis. – Deanna Jul 18 '12 at 12:07
Holy s**t. Cool picture! – draks ... Jul 19 '12 at 8:13
– Bitrex Jul 19 '12 at 14:20