Get the duration of flight if the rocket were to take off from either planet on the given round.
(&self, round: Rounds)
| 578 | /// Get the duration of flight if the rocket were to take off from either |
| 579 | /// planet on the given round. |
| 580 | pub fn duration(&self, round: Rounds) -> Rounds { |
| 581 | let arg = 2. * f32::consts::PI / self.period_s as f32 * round as f32; |
| 582 | let sin = ((self.amplitude_s as f32) * f32::sin(arg)) as i32; |
| 583 | (sin + self.center_s) as Rounds |
| 584 | } |
| 585 | |
| 586 | /// Generates a random orbit pattern. |
| 587 | pub fn random(seed: u16) -> OrbitPattern { |
no outgoing calls