Skip to main content

RocheContext

Struct RocheContext 

Source
pub struct RocheContext {
    pub q: f64,
    pub star: Star,
    pub spin: f64,
    pub x_l1: f64,
}
Expand description

RocheContext is a basic struct packaging the mass ratio, q=M2/M1, the star (i.e. the Primary or Secondary), the spin of that star, and the x-coordinate of the L1 point together with the functions that accept these values as inputs. x_l1 is calculated on initialisation with RocheContext::new(q, star, spin) and saves it being recalculated over and over in loops.

Fields§

§q: f64§star: Star§spin: f64§x_l1: f64

Implementations§

Source§

impl RocheContext

Source

pub fn new(q: f64, star: Star, spin: f64) -> Result<Self, RocheError>

Source

pub fn potential( &self, earth: &Vec3, p: &Vec3, lam: f64, ) -> Result<f64, RocheError>

Source

pub fn gradient( &self, earth: &Vec3, p: &Vec3, lam: f64, ) -> Result<(f64, f64), RocheError>

Source

pub fn potential_grad( &self, earth: &Vec3, p: &Vec3, lam: f64, ) -> Result<(f64, f64, f64), RocheError>

Source

pub fn ref_sphere(&self, ffac: f64) -> Result<(f64, f64), RocheError>

Source

pub fn face( &self, direction: Vec3, rref: f64, pref: f64, acc: f64, ) -> Result<(Vec3, Vec3, f64, f64), RocheError>

Source

pub fn ingress_egress( &self, ffac: f64, iangle: f64, delta: f64, r: &Vec3, ingress: &mut f64, egress: &mut f64, ) -> Result<bool, RocheError>

Source

pub fn star_eclipse( &self, r: f64, ffac: f64, iangle: f64, posn: &Vec3, delta: f64, roche: bool, star: Star, eclipses: &mut Etype, ) -> Result<(), RocheError>

Source

pub fn pot_min( &self, cosi: f64, sini: f64, p: &Vec3, phi1: f64, phi2: f64, lam1: f64, lam2: f64, rref: f64, pref: f64, acc: f64, phi: &mut f64, lam: &mut f64, ) -> Result<bool, RocheError>

Source

pub fn x_l1(&self) -> Result<f64, RocheError>

Source

pub fn x_l1_asyncronous(&self) -> Result<f64, RocheError>

Source

pub fn x_l2(&self) -> Result<f64, RocheError>

Source

pub fn x_l3(&self) -> Result<f64, RocheError>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Ungil for T
where T: Send,