Hi,
You might want to check for a WCS library in whatever programming language you are using.
The real documentation is here,
https://fits.gsfc.nasa.gov/fits_wcs.htmlin particular, "paper II" is what you want, but is pretty opaque.
In the Astrometry.net code, the conversion functions are here,
https://github.com/dstndstn/astrometry.net/blob/master/util/sip.cin particular, tan (or sip) tan_radec2pixelxy. If you see "iwc" there, that's short for 'intermediate world coordinates', which are like relative delta-RA, delta-Dec coordinates.
By the way, "SIP" is the name of the convention for how we represent distortion corrections -- you can turn this off in the web API if you don't want it -- while TAN is the "vanilla" version without any distortion corrections.
cheers,
--dustin