Comments (4)
I think I understand what you're saying, but I'm not able to reconcile it with the code base.
Could you provide an example input / output that aligns with your expectations like:
let point_1 = point(x: ???, y: ???);
let point_2 = point(x: ???, y: ???);
let bearing = point_1.bearing(point_2);
assert_eq!(bearing, ???);
from geo.
Sorry for not coming back to this sooner. After some more testing, I concluded that my hypothesis of N=90 and E=0 is wrong. Here is an example test:
#[test]
fn a_different_angle() {
let p_1 = point!(x: 52.323434, y: 4.822623);
let p_2 = point!(x: 52.327790, y: 4.851333);
let b_1 = p_1.haversine_bearing(p_2);
assert_relative_eq!(b_1, 76.0, epsilon = 1.0e-6);
}
with this output (geo 0.24.1
):
left = 8.5969044325273
right = 76.0
According to this online calculator, the bearing is 76 degrees (no more significant digits unfortunately). When looking at a map, it's at least clear to me that it shouldn't be 8.6 degrees. Not sure what's going on here, since the other tests pass.
from geo.
Assuming that you are operating in the Netherlands, it looks like you've swapped your latitude (y) and longitude (x).
Feel free to follow up if I'm mistaken.
from geo.
Thanks, that clears it up. It's confusing that lat/lon and x/y are not a one to one mapping. Maybe this is a useful addition to the documentation?
from geo.
Related Issues (20)
- Allow returning the source of edges from BoolOp.
- MultiPoint::len
- Panic in BooleanOps::union for Polygon<f32> HOT 6
- VecSet may cause panics HOT 7
- Proposal: Common abstraction layer for collection types (via `Deref` and `DerefMut`) HOT 2
- Add delauney triangulation algorithm to root `geo` crate docs index
- Thoughts on algorithms for trait-based geometries
- concave_hull returns nonsense results for simple polygons HOT 1
- Panic in RegionAssembly reproducibly HOT 4
- Clarify that current cross-track distance uses spherical (Haversine) earth model, add Ellipsoidal (Vincenty) version HOT 2
- Missing `contains` implementations
- `is_valid` for all geometry types. HOT 3
- Problems building with Rust 1.75.0 HOT 1
- Add is_equal_topo method to IntersectionMatrix to determine topological equality
- How to calculate intersection area of two rotated rectangles? HOT 2
- Missing PointZ implementations HOT 1
- Latest ahash dep and Rust 1.70.0 are incompatible HOT 4
- 3D (3-dimensional) data types HOT 2
- Rhumb destinations do not wrap angles after the first pole intersection HOT 8
- GeodesicDestination produces cyclcically incosistent results HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from geo.