Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/sim_elements.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
extern crate num;

use vector::Vector2;
use num::{Float,Integer,NumCast};
use num::{self,Float,Integer,NumCast};
use simulation::SimData;

pub trait Simulable<T,U> where T: Float, U: Integer {
Expand Down Expand Up @@ -40,4 +38,4 @@ impl<T,U> Simulable<T,U> for Planet<T> where T: Float, U: Integer + NumCast {
my_data.vel = my_data.vel + inst_accel * dt;
my_data.pos = my_data.pos + my_data.vel * dt;
}
}
}
6 changes: 2 additions & 4 deletions src/simulation.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
extern crate num;

use std::fmt;
use num::{Float,Integer,NumCast};
use num::{self,Float,Integer,NumCast};
use vector::Vector2;
use sim_elements::Simulable;

Expand Down Expand Up @@ -72,4 +70,4 @@ impl<T,U> fmt::Display for Simulation<T,U> where T: Float + fmt::Display, U: Int
}
Ok(())
}
}
}
6 changes: 2 additions & 4 deletions src/vector.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
extern crate num;

use std::fmt;
use num::Float;
use num::{self,Float};
use std::ops::{Add,Sub,Mul,Div};

#[derive(Debug, Eq, PartialEq, Clone, Copy)]
Expand Down Expand Up @@ -106,4 +104,4 @@ mod tests{
fn norm_test() {
assert_eq!(Vector2::<f64> { x: 4., y: -3.}.norm(), 5_f64);
}
}
}