Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Functions
orbits.hpp File Reference
#include "shambackends/math.hpp"
#include "shammath/matrix.hpp"
#include "shamunits/Constants.hpp"
#include "shamunits/UnitSystem.hpp"
+ Include dependency graph for orbits.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

auto shamphys::get_binary_pair (double m1, double m2, double a, double e, double nu, double G)
 Convert a binary system from Keplerian to Cartesian coordinates.
 
auto shamphys::get_binary_pair (double m1, double m2, double a, double e, double nu, const shamunits::UnitSystem< double > usys=shamunits::UnitSystem< double >{})
 Shortcut for get_binary_pair with G from UnitSystem.
 
auto shamphys::get_binary_rotated (double m1, double m2, double a, double e, double nu, double G, double roll, double pitch, double yaw)
 Rotate a binary orbit by Euler angles and return the positions and velocities of the two objects.
 
auto shamphys::get_binary_rotated (double m1, double m2, double a, double e, double nu, const shamunits::UnitSystem< double > usys, double roll, double pitch, double yaw)
 Shortcut for get_binary_rotated with G from UnitSystem.
 

Detailed Description

Author
Timothée David–Cléris (tim.s.nosp@m.hamr.nosp@m.ock@p.nosp@m.roto.nosp@m.n.me)

Definition in file orbits.hpp.

Function Documentation

◆ get_binary_pair() [1/2]

auto shamphys::get_binary_pair ( double  m1,
double  m2,
double  a,
double  e,
double  nu,
const shamunits::UnitSystem< double >  usys = shamunits::UnitSystem<double>{} 
)

Shortcut for get_binary_pair with G from UnitSystem.

Definition at line 67 of file orbits.hpp.

+ Here is the call graph for this function:

◆ get_binary_pair() [2/2]

auto shamphys::get_binary_pair ( double  m1,
double  m2,
double  a,
double  e,
double  nu,
double  G 
)
inline

Convert a binary system from Keplerian to Cartesian coordinates.

This function calculates the positions and velocities of two objects in a binary system using their masses, semi-major axis, eccentricity, and true anomaly.

Parameters
m1Mass of the first object.
m2Mass of the second object.
aSemi-major axis of the system.
eEccentricity of the system.
nuTrue anomaly of the system (in radians).
GGravitational constant.
Returns
A tuple containing four elements: the positions of the two objects and the velocities of the two objects.

Definition at line 40 of file orbits.hpp.

+ Here is the call graph for this function:

◆ get_binary_rotated() [1/2]

auto shamphys::get_binary_rotated ( double  m1,
double  m2,
double  a,
double  e,
double  nu,
const shamunits::UnitSystem< double >  usys,
double  roll,
double  pitch,
double  yaw 
)

Shortcut for get_binary_rotated with G from UnitSystem.

Definition at line 174 of file orbits.hpp.

+ Here is the call graph for this function:

◆ get_binary_rotated() [2/2]

auto shamphys::get_binary_rotated ( double  m1,
double  m2,
double  a,
double  e,
double  nu,
double  G,
double  roll,
double  pitch,
double  yaw 
)

Rotate a binary orbit by Euler angles and return the positions and velocities of the two objects.

Parameters
m1Mass of the first object.
m2Mass of the second object.
aSemi-major axis of the system.
eEccentricity of the system.
nuTrue anomaly of the system (in radians).
GGravitational constant.
rollRotation about the X-axis (in radians).
pitchRotation about the Y-axis (in radians).
yawRotation about the Z-axis (in radians).
Returns
A tuple containing four elements: the rotated positions of the two objects and the rotated velocities of the two objects.

Definition at line 152 of file orbits.hpp.

+ Here is the call graph for this function: