This repository contains a C++ mathematical model for estimating the apparent trajectory of a celestial object from three calibrated observations.
The model was developed as part of an astronomical tracking mount project, where the goal was to estimate the future azimuth and elevation of an observed object before integrating the algorithm with an Arduino-based servo-control system.
The program uses three initial observations of a celestial object, given as elevation and azimuth angles, to construct an approximate trajectory on the celestial sphere.
The model:
- converts spherical coordinates into Cartesian coordinates;
- constructs a trajectory plane from three observed points;
- applies Gram-Schmidt orthonormalisation;
- estimates the circular trajectory produced by the intersection between the plane and the unit sphere;
- generates future trajectory points over a 24-hour interval;
- converts the predicted Cartesian positions back into elevation and azimuth;
- exports the generated data to CSV.
The model includes an approximate atmospheric-refraction correction with pressure and temperature scaling.
The correction is used to convert observed apparent altitude values into estimated true/geometric altitude values before the trajectory is computed. The predicted values are then converted back into apparent altitude for output and comparison.
This makes the model more realistic when comparing against reference observations generated with tools such as Stellarium.
The program generates a file named:
data.csv
with the following columns:
time_s,x,y,z,theta_deg,psi_deg
where:
time_sis the elapsed simulation time in seconds;x, y, zare the predicted Cartesian coordinates on the unit sphere;theta_degis the predicted elevation angle;psi_degis the predicted azimuth angle.
Implemented:
- C++ trajectory-estimation model
- coordinate transformations between spherical and Cartesian systems
- three-point geometric trajectory construction
- approximate atmospheric-refraction correction
- CSV export for visualisation or further analysis
In progress:
- integration with Arduino servo-control firmware
- automatic conversion of predicted angles into motor commands
- end-to-end validation with the physical tracking mount
- C++
- Mathematical modelling
- Coordinate transformations
- Atmospheric-refraction approximation
- Celestial tracking simulation
This model is part of a larger collaborative mechatronics project involving an astronomical tracking mount, Arduino-based electronics, dual-servo actuation and mechanical transmission design.
The C++ model is used as the mathematical core for estimating the object's apparent motion before full hardware integration.