fix direction of orbital velocity
This commit is contained in:
parent
1614ece72a
commit
24a9b208bd
|
@ -176,7 +176,7 @@ pub fn orbital_velocity(coords: DVec3, mass: f64) -> DVec3 {
|
|||
let speed = (G * mass / r).sqrt();
|
||||
|
||||
// This generates a perpendicular orbital vector in the prograde direction
|
||||
let perpendicular = DVec3::new(-coords.z, 0.0, -coords.x).normalize();
|
||||
let perpendicular = DVec3::new(coords.z, 0.0, -coords.x).normalize();
|
||||
|
||||
return perpendicular * speed;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue