This commit is contained in:
randogoth 2024-04-10 06:04:34 +03:00
parent a56705383f
commit 898c13f70e
3 changed files with 8 additions and 2 deletions

2
Cargo.lock generated
View file

@ -569,7 +569,7 @@ dependencies = [
[[package]] [[package]]
name = "xenobalanus" name = "xenobalanus"
version = "0.1.3" version = "0.1.4"
dependencies = [ dependencies = [
"delaunator", "delaunator",
"geo", "geo",

View file

@ -1,6 +1,6 @@
[package] [package]
name = "xenobalanus" name = "xenobalanus"
version = "0.1.3" version = "0.1.4"
edition = "2021" edition = "2021"
[lib] [lib]

View file

@ -40,6 +40,12 @@ impl Point {
bearing bearing
} }
pub fn bearing_rad(&self, point: Point) -> f32 {
let delta_x = point.x - self.x;
let delta_y = point.y - self.y;
delta_y.atan2(delta_x)
}
} }
impl From<Point> for Coord<f32> { impl From<Point> for Coord<f32> {