removed unused imports
This commit is contained in:
parent
0444d97d13
commit
d6ae1b03b1
1282
day24/Cargo.lock
generated
1282
day24/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -6,6 +6,4 @@ edition = "2021"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
ndarray = "0.15.6"
|
||||
ndarray-linalg = { version = "0.16", features = ["intel-mkl-static"] }
|
||||
num = "0.4.1"
|
||||
|
@ -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. {
|
||||
|
Loading…
Reference in New Issue
Block a user