This is an R package which converts from Earth-Centered-Earth-Fixed XYZ to Lat-Long-Altitude and back. Based on js implementation at http://www.oc.nps.edu/oc2902w/coord/llhxyz.htm
I have made no attempt to verify the accuracy of this code, just made sure the answers match the source.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.