Basic vector arithmetic for the orbit picker

[?]
Jun 15, 2021, 12:01 PM
EWUP525BMEMX2GCD4FFHTYLO74TBKXJSILFMRQMPOX7ZWZU3JZZQC

Dependencies

  • [2] 4LTVYHHI Add async runtime for the orbital parameter picker
  • [*] K3V2JNKC Initialize sub-project for choosing lunar orbital parameters

Change contents

  • edit in orbitpick/src/main.rs at line 2
    [2.11]
    [2.11]
    #[derive(Debug)]
    pub struct V3 {
    pub x: f64,
    pub y: f64,
    pub z: f64
    }
    impl std::fmt::Display for V3 {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
    write!(f, "[{}, {}, {}]", self.x, self.y, self.z)
    }
    }
  • edit in orbitpick/src/main.rs at line 16
    [2.12]
    [2.12]
    impl std::ops::Mul<f64> for V3 {
    type Output = V3;
    fn mul(self, f: f64) -> Self::Output {
    V3 {
    x: self.x * f,
    y: self.y * f,
    z: self.z * f
    }
    }
    }
    impl std::ops::Add<V3> for V3 {
    type Output = V3;
    fn add(self, rhs: V3) -> V3 {
    V3 {
    x: self.x + rhs.x,
    y: self.y + rhs.y,
    z: self.z + rhs.z
    }
    }
    }