removed unused imports
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
use num::ToPrimitive;
|
||||
use std::fs::read_to_string;
|
||||
use std::time::Instant;
|
||||
|
||||
@@ -159,8 +158,7 @@ fn main() {
|
||||
let l2p1 = (h2.pos.0 as f64, h2.pos.1 as f64);
|
||||
let l2p2 = ((h2.pos.0 + h2.vel.0) as f64, (h2.pos.1 + h2.vel.1) as f64);
|
||||
match xy_intersection(l1p1, l1p2, l2p1, l2p2) {
|
||||
LineIntersection::Intersects((xr, yr)) => {
|
||||
let (x, y) = (xr.to_f64().unwrap(), yr.to_f64().unwrap());
|
||||
LineIntersection::Intersects((x, y)) => {
|
||||
// Check if it's not in the past, thankfully velocity components are never 0
|
||||
if (x - h1.pos.0 as f64) / h1.vel.0 as f64 >= 0.
|
||||
&& (x - h2.pos.0 as f64) / h2.vel.0 as f64 >= 0. {
|
||||
|
Reference in New Issue
Block a user