rad
This commit is contained in:
parent
1ee9eef675
commit
c1cc84f15d
3 changed files with 8 additions and 2 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
|
@ -585,7 +585,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "xenobalanus"
|
||||
version = "0.1.3"
|
||||
version = "0.1.4"
|
||||
dependencies = [
|
||||
"delaunator",
|
||||
"geo",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "xenobalanus"
|
||||
version = "0.1.3"
|
||||
version = "0.1.4"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
|
|
|
|||
|
|
@ -44,6 +44,12 @@ impl Point {
|
|||
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> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue