Orrery
A GPU-accelerated N-body gravitational simulator
Loading...
Searching...
No Matches
kepler.hpp
Go to the documentation of this file.
1#pragma once
2
24
26#include "orrery/core/types.hpp"
27
28namespace orrery::initial_conditions {
29
39 core::Real primary_mass = 1;
40 core::Real secondary_mass = 1;
41
45 core::Real semi_major_axis = 1;
46
54 core::Real eccentricity = 0;
55};
56
69[[nodiscard]] core::ParticleData make_kepler_orbit(const KeplerParameters& parameters);
70
75[[nodiscard]] core::Real kepler_period(const KeplerParameters& parameters);
76
82[[nodiscard]] core::Real kepler_energy(const KeplerParameters& parameters);
83
90[[nodiscard]] core::Real kepler_angular_momentum(const KeplerParameters& parameters);
91
94[[nodiscard]] core::Real kepler_periapsis_distance(const KeplerParameters& parameters);
95
96} // namespace orrery::initial_conditions
Storage for a set of point masses in structure-of-arrays layout.
Definition particle_data.hpp:43
core::Real kepler_periapsis_distance(const KeplerParameters &parameters)
The separation at periapsis, a(1 - e), which is where the generated configuration starts.
core::ParticleData make_kepler_orbit(const KeplerParameters &parameters)
Two particles at periapsis, in the centre-of-mass frame at rest.
core::Real kepler_energy(const KeplerParameters &parameters)
The total energy, -G m1 m2 / 2a.
core::Real kepler_period(const KeplerParameters &parameters)
The orbital period, from Kepler's third law.
core::Real kepler_angular_momentum(const KeplerParameters &parameters)
The magnitude of the total angular momentum, mu sqrt(G M a (1 - e^2)), where mu is the reduced mass a...
The particle store: one contiguous array per component.
A bound two-body orbit, described by its elements.
Definition kepler.hpp:38
core::Real eccentricity
Zero for a circle, approaching one for an orbit that grazes the centre.
Definition kepler.hpp:54
core::Real semi_major_axis
The semi-major axis of the relative orbit, that is, of the separation between the two bodies rather t...
Definition kepler.hpp:45
The scalar and index types that every layer of the project agrees on.