Comments (6)
fwiw this happens to me as well.
from geo.
I agree, an almost_equals function is a great idea here.
from geo.
Would the implementation be anything more than:
fn almost_equals<F: Float>(f1, f2) -> bool {
f1.abs_sub(f2) < f1::epsilon()
}
from geo.
In this particular case, I suspect that the test will still fail. epsilon
must be scaled. Something like that:
fn almost_equals<F: Float>(f1: F, f2: F) -> bool {
f1.abs_sub(f2) < F::epsilon() * F::max(f1, f2) * F::from(1e3).unwrap()
}
for forgetting the 3 last digits.
from geo.
A PR was opened for this: #82
Anyone have thoughts?
from geo.
Closed with #82
from geo.
Related Issues (20)
- "cargo add geo-types -F rstar" -> failed to resolve: use of undeclared crate or module `approx` HOT 1
- Add Monotone Chain algorithm.
- Add a (Robust)LineIntersector HOT 1
- simplify_vw_preserve causing self-intersecting ring HOT 12
- Panic in the intersection function HOT 2
- Recursion overflow HOT 1
- GeodesicBearing produces NAN when y value is outside of [-90, 90] HOT 6
- Improve Documentation for HaversineIntermediate HOT 3
- panic in polygon intersection HOT 4
- HaversineDestination results don't wrap at the antimeridian as expected HOT 1
- Add more tests for `line_segmentize` HOT 2
- Haversine Closest Point panic on intersection HOT 10
- Override `PartialEq` derives when a `approx-partial-eq` feature flag is enabled. HOT 4
- Borrowed rstar CachedEnvelope container results in un-ergonomic code
- Clippy has a new problem with one of our partial_cmp impls HOT 2
- Tests fail on main due to floating point imprecision. HOT 1
- Allow returning the source of edges from BoolOp.
- MultiPoint::len
- Panic in BooleanOps::union for Polygon<f32> HOT 2
- VecSet may cause panics HOT 7
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.