Commit Graph

20 Commits

Author SHA1 Message Date
Andrew Tridgell
13a2367278 AP_Math: change optimisation from -O3 to -O2 2019-09-28 08:57:26 +10:00
Randy Mackay
614b0f6dc8 AP_Math: Polygon_intersects handles unclosed polygons 2019-07-07 04:08:34 -07:00
Randy Mackay
071e340827 AP_Math: Polygon_closest_distance_line returns neg numbers
value is negative distance from intersection to p2
2019-06-11 13:13:22 +09:00
Andrew Tridgell
6eb816fd3b AP_Math: add Polygon_closest_distance_line
Also add optimisations
2019-06-11 13:13:22 +09:00
Peter Barker
36fe9a18a0 AP_Math: make Polygon_outside cope with being passed unclosed polygons 2019-05-29 15:34:02 +10:00
Peter Barker
51a0401383 AP_Math: correct Polygon_outside floating point instatiation
This routine was entemplatificated from the integer version, which was
designed to be perfect across representable ranges of points.  The
floating point version suffered from a rounding problem.
2019-05-28 09:08:07 +10:00
Peter Barker
f09efe0908 AP_Math: correct URL for Polygon_outside algorithm 2019-05-24 13:17:43 +10:00
Peter Barker
b22d3a0103 AP_Math: avoid casting floats to int32's for temporary variables
Note the use of 64-bit integer arithmetic further down, however
2019-04-23 09:36:17 +10:00
khancyr
15398f8b0e AP_Math: correct variable init and remove define in polygon 2017-07-31 17:35:08 +09:00
Pierre Kancir
6bf1322633 AP_Math: polygon.cpp correct float comparison 2016-12-06 09:31:21 -08:00
Mathieu OTHACEHE
152edf7189 Global: remove mode line from headers
Using a global .dir-locals.el file is a better alternative than
reincluding the same emacs header in every file of the project.
2016-10-24 09:42:01 -02:00
Daniel Ricketts
249d95b413 AP_Math: add Polygon_outside and Polygon_complete functions 2016-06-25 15:55:55 +09:00
uncrustify
b5bee9deff uncrustify libraries/AP_Math/polygon.cpp 2012-08-21 19:03:34 -07:00
Andrew Tridgell
11b8d56434 added comment in polygon code 2011-12-21 23:31:38 +11:00
Andrew Tridgell
6efa2e53cb AP_Math: re-work polygon algorithm for perfect precision
using sign checking and 64 bit integer math only when needed results
in an algorithm that is just as fast as the floating point version,
but has perfect results for any representable lat/lng
2011-12-19 18:52:56 +11:00
Andrew Tridgell
a3a0e5646f polygon: improve the speed and precision of the polygon algorithm
now takes 156 usec per test, with a 11 point boundary
2011-12-18 12:59:50 +11:00
Andrew Tridgell
42522baf9f geofence: store fence points as int32_t
this keeps maximum precision in fence boundaries
2011-12-16 20:11:51 +11:00
Andrew Tridgell
9b6bab8904 AP_Math: better polygon algorithm
this one seems to do better with single precision floating point
2011-12-16 20:11:51 +11:00
Andrew Tridgell
85e295332f AP_Math: added Polygon_complete() function
used to veryify user supplied boundaries
2011-12-15 14:42:34 +11:00
Andrew Tridgell
117a98f9a2 AP_Math: added a Polygon_outside() function
this tests if a point is outside of a polygon. This will be used as
part of our geo-fencing support, and also for a new 'fenced mode'
2011-12-15 14:34:58 +11:00