These can easily be calculated using Cesium. Just move the camera to any spot on Earth, then look at either the Sun or Moon and the heading and pitch match those given by the many online calculators
I made some buttons which automatically turn exactly toward the Sun or Moon and calculate HPR angles to make it easier. This is much easier than having to type in coordinates or city&state. Perhaps I should make it even easier still: instead of moving the camera just hover the cursor over the spot you want to measure.
Actually with Cesium it is more accurate as it considers the altitude of the terrain, though the difference would be negligible.