You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.2 KiB
40 lines
1.2 KiB
#ifndef TEST_UTILITIES_H |
|
#define TEST_UTILITIES_H |
|
|
|
#include "simulation.h" |
|
#include "physics.h" |
|
|
|
struct OrbitalMetrics { |
|
double kinetic_energy; |
|
double potential_energy; |
|
double total_energy; |
|
double orbital_radius; |
|
double velocity_magnitude; |
|
double angular_position; |
|
}; |
|
|
|
struct OrbitTracker { |
|
double initial_angle; |
|
double previous_angle; |
|
int quadrant_transitions; |
|
bool orbit_completed; |
|
double time_at_completion; |
|
int body_index; |
|
double min_time_days; |
|
}; |
|
|
|
double calculate_kinetic_energy(CelestialBody* body); |
|
double calculate_potential_energy_pair(CelestialBody* body1, CelestialBody* body2); |
|
double calculate_system_total_energy(SimulationState* sim); |
|
OrbitalMetrics calculate_orbital_metrics(CelestialBody* body, CelestialBody* parent); |
|
|
|
OrbitTracker* create_orbit_tracker(int body_index); |
|
OrbitTracker* create_orbit_tracker_with_min_time(int body_index, double min_time_days); |
|
void reset_orbit_tracker(OrbitTracker* tracker); |
|
void update_orbit_tracker(OrbitTracker* tracker, CelestialBody* body, CelestialBody* parent, double current_time); |
|
void destroy_orbit_tracker(OrbitTracker* tracker); |
|
|
|
bool compare_double(double a, double b, double tolerance); |
|
bool compare_vec3(Vec3 a, Vec3 b, double tolerance); |
|
|
|
#endif
|
|
|