simplify double map into single map

This commit is contained in:
Quaternions 2024-10-04 12:47:52 -07:00
parent bded9fccdf
commit 7cc0fd59c8

View File

@ -877,8 +877,7 @@ impl Body{
T1:integer::Fix<Planar64>, T1:integer::Fix<Planar64>,
{ {
// a*dt + v // a*dt + v
self.acceleration.map(|elem|dt*elem) self.acceleration.map(|elem|(dt*elem).divide().fix())+self.velocity
.map(|elem|elem.divide().fix())+self.velocity
} }
pub fn advance_time_ratio_dt(&mut self,dt:model_physics::GigaTime){ pub fn advance_time_ratio_dt(&mut self,dt:model_physics::GigaTime){
self.position=self.extrapolated_position_ratio_dt(dt); self.position=self.extrapolated_position_ratio_dt(dt);