Package com.google.common.geometry
Class S2EdgeUtil.LongitudePruner
java.lang.Object
com.google.common.geometry.S2EdgeUtil.LongitudePruner
- Enclosing class:
S2EdgeUtil
The purpose of this class is to find edges that intersect a given longitude interval. It can be
used as an efficient rejection test when attempting to find edges that intersect a given
region. It accepts a vertex chain v0, v1, v2, ... and returns a boolean value indicating
whether each edge intersects the specified longitude interval.
This class is not currently used as the XYZPruner is preferred for S2Loop, but this should be usable in similar circumstances. Be wary of the cost of atan2() in conversions from S2Point to longitude!
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLongitudePruner
(S1Interval interval, S2Point v0) 'interval' is the longitude interval to be tested against, and 'v0' is the first vertex of edge chain. -
Method Summary
Modifier and TypeMethodDescriptionboolean
intersects
(S2Point v1) Returns true if the edge (v0, v1) intersects the given longitude interval, and then saves 'v1' to be used as the next 'v0'.
-
Field Details
-
interval
-
lng0
private double lng0
-
-
Constructor Details
-
LongitudePruner
'interval' is the longitude interval to be tested against, and 'v0' is the first vertex of edge chain.
-
-
Method Details
-
intersects
Returns true if the edge (v0, v1) intersects the given longitude interval, and then saves 'v1' to be used as the next 'v0'.
-