Remove unused stuff
This commit is contained in:
parent
103e8c309c
commit
d9fa6b6d43
31
src/main.rs
31
src/main.rs
@ -11,7 +11,6 @@ mod input;
|
|||||||
|
|
||||||
type Point = geo::Point<f64>;
|
type Point = geo::Point<f64>;
|
||||||
type Line = geo::Line<f64>;
|
type Line = geo::Line<f64>;
|
||||||
type LineString = geo::LineString<f64>;
|
|
||||||
type Polygon = geo::Polygon<f64>;
|
type Polygon = geo::Polygon<f64>;
|
||||||
|
|
||||||
// 30 km/h = 8+1/3 m/s
|
// 30 km/h = 8+1/3 m/s
|
||||||
@ -246,33 +245,3 @@ fn max_possible_delay(total_distance: f64, lisa: Point) -> f64 {
|
|||||||
let y_l = lisa.y();
|
let y_l = lisa.y();
|
||||||
y_l - (3.0 * x_l.powi(2)).sqrt() - total_distance * 2.0
|
y_l - (3.0 * x_l.powi(2)).sqrt() - total_distance * 2.0
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Gehe direkt zum Bus. Gibt die Punkte zurück, bei denen Lisa nicht auf den Bus warten müsste.
|
|
||||||
fn to_bus(bus: Point, start: Point) -> Vec<Point> {
|
|
||||||
let x_l = start.x();
|
|
||||||
let y_l = start.y();
|
|
||||||
let x_b = bus.x();
|
|
||||||
assert_eq!(x_b, 0.0);
|
|
||||||
let y_b = bus.y();
|
|
||||||
|
|
||||||
let b = 4.0 * (y_l - y_b);
|
|
||||||
let unter_wurzel =
|
|
||||||
b.powi(2) + 12.0 * (-x_l.powi(2) - y_l.powi(2) - y_b.powi(2) + 2.0 * y_b * y_l);
|
|
||||||
if unter_wurzel >= 0.0 {
|
|
||||||
let wurzel = unter_wurzel.sqrt();
|
|
||||||
let wurzel_ = wurzel / (-6.0);
|
|
||||||
let b_ = b / 6.0;
|
|
||||||
let d1 = b_ + wurzel_;
|
|
||||||
let d2 = b_ - wurzel_;
|
|
||||||
if d1 > (0.0) && d2 > (0.0) {
|
|
||||||
vec![
|
|
||||||
bus.translate(0.0, (2.0) * d1),
|
|
||||||
bus.translate(0.0, (2.0) * d2),
|
|
||||||
]
|
|
||||||
} else {
|
|
||||||
vec![]
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
vec![]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user