Satellite Brightness Estimation
Could you use SunCalc.getTimes(date, lat, lng, height) and give it the current altitude of the satellite? Would be like calculating the sunrise/sunset times on a REALLY big mountain.
My plan is to do a rough calculation of 0-100% for how close the satellite is to solar noon and then multiple that by 0-100% for how far away the observer is from solar noon to give you a scale for how optimal it is to look for the satellite right now (a poor man's phase angle calculation I believe).
Assuming I am not missing something glaring here - you could then iterate that over time to get the ideal times to look for a satellite with a telescope for any lat, lon on earth.
Here is what I was looking for:
Satellite in Sun Math: https://www.celestrak.com/columns/v03n01/
Angle Math in 3D: https://www.geeksforgeeks.org/find-all-angles-of-a-triangle-in-3d/
Dot Math in JS might be useful too: https://mathjs.org/docs/reference/functions/dot.html
Was able to calculate which satellites were in umbral and pneumbral using the information from Celestrak. Pneumbral calculations may be off due to incorrect earth position (converting from ECI to satellite centered reference system).
Sunlight added in d64200274db9b72adee5ef8e64a08c161ac5fcde. Still need to calculate brightness using an external database of visual magnitude.
double distanceToSatellite = 485; //This is in KM double phaseAngleDegrees = 113.1; //Angle from sun->satellite->observer double pa = phaseAngleDegrees * 0.0174533; //Convert the phase angle to radians double intrinsicMagnitude = -1.8; //-1.8 is std. mag for iss
double term_1 = intrinsicMagnitude; double term_2 = 5.0 * Math.Log10(distanceToSatellite / 1000.0);
double arg = Math.Sin(pa) + (Math.PI - pa) * Math.Cos(pa); double term_3 = -2.5 * Math.Log10(arg);
double apparentMagnitude = term_1 + term_2 + term_3;
Added in 5a300c3c72a1199cc15dabd299a23c65b8dc7109