Open gatelli opened 3 years ago
This code shows a (tiny) difference in results:
a=new Date("2023-03-01 12:00:00Z");
jdo = new A.JulianDay(a)
coord1 = A.EclCoord.fromWgs84(42,12,0);
coord2 = A.EclCoord.fromWgs84(42,12,10000);
res1=A.Solar.topocentricPosition(jdo, coord1, true); // true/false = with/without refraction
res2=A.Solar.topocentricPosition(jdo, coord2, true)
console.log("Azimuth:")
console.log("Rad:" , res1.hz.az +Math.PI , res2.hz.az+Math.PI, (((res2.hz.az-res1.hz.az)/res1.hz.az)*100).toFixed(8) + "%");
console.log("Deg:" , res1.hz.az*180/Math.PI + 180, res2.hz.az*180/Math.PI + 180, (((res2.hz.az-res1.hz.az)/res1.hz.az)*100).toFixed(8) + "%");
console.log("Elevation:")
console.log("Rad:" , res1.hz.alt, res2.hz.alt, (((res2.hz.alt-res1.hz.alt)/res1.hz.alt)*100).toFixed(8) + "%");
console.log("Deg:" , res1.hz.alt*180/Math.PI, res2.hz.alt*180/Math.PI, (((res2.hz.alt-res1.hz.alt)/res1.hz.alt)*100).toFixed(8) + "%");
Output (alt = 0, alt = 10000, difference):
Airless:
Azimuth: 191.51809117720137 191.51809117719634 -0.00000000%
Elevation: 39.75331679175222 39.75331384737008 -0.00000741%
Refraction:
Azimuth: 191.51809117720137 191.51809117719634 -0.00000000%
Elevation: 39.772727982539074 39.77272504020162 -0.00000740%
Results from NASA Horizons (azimuth, elevation):
Altitude = 0:
Altitude = 10000:
Code output manually reordered as Horizons:
Altitude = 0
Altitude = 10000
I found the calculation doesn't take into account the altitude, although the parameter h is included in coordinates. It doesn't modify anything for the results, and it should. Can you confirm that ? Thx