Uses of Class
com.google.common.geometry.S2Point
-
Uses of S2Point in com.google.common.geometry
Subclasses of S2Point in com.google.common.geometryModifier and TypeClassDescriptionstatic classA point with a known containment relationship.Subclasses with type arguments of type S2Point in com.google.common.geometryModifier and TypeClassDescriptionstatic classAn S2Shape representing a list of S2Points.Classes in com.google.common.geometry that implement interfaces with type arguments of type S2PointModifier and TypeClassDescriptionclassAn S2Point represents a point on the unit sphere as a 3D vector.Fields in com.google.common.geometry declared as S2PointModifier and TypeFieldDescriptionstatic final S2PointS2Point.ORIGINOrigin of the coordinate system, [0,0,0].static final S2PointS2Point.X_NEGOpposite direction of the x-axis.static final S2PointS2Point.X_POSDirection of the x-axis.static final S2PointS2Point.Y_NEGOpposite direction of the y-axis.static final S2PointS2Point.Y_POSDirection of the y-axis.static final S2PointS2Point.Z_NEGOpposite direction of the z-axis.static final S2PointS2Point.Z_POSDirection of the z-axis.Methods in com.google.common.geometry that return S2PointModifier and TypeMethodDescriptionReturns add(this,p).static final S2PointReturns the component-wise addition of 'p1' and 'p2'.S2Cap.axis()S2Point.Builder.build()Returns a newS2Pointcopied from the current state of this builder.S2Iterator.center()Returns the center of the cell (used as a reference point for shape interiors.)static S2PointS2ShapeIndexMeasures.centroid(S2ShapeIndex shapeIndex) Returns the centroid of all shapes whose dimension is maximal within shapeIndex, multiplied by the measure of those shapes.Returns crossProd(this,p).static final S2PointReturns the R3 vector cross product of 'p1' and 'p2'.static S2PointS2Point.decode(InputStream is) Returns a new S2Point decoded from the given input stream.S2Point.div(double scale) Returns div(this,scale).static final S2PointReturns the component-wise division of 'p' by 'm'.abstract S2PointS2EdgeIndex.edgeFrom(int index) Returns the starting vertex of the edge at offsetindex.abstract S2PointS2EdgeIndex.edgeTo(int index) Returns the ending vertex of the edge at offsetindex.S2Point.fabs()Returns fabs(this).static final S2PointReturns the component-wise absolute point from 'p'.S2Projections.faceSiTiToXyz(int face, long si, long ti) Convert (face, si, ti) coordinates to a direction vector (not necessarily unit length.)static S2PointS2Projections.faceUvToXyz(int face, double u, double v) Convert (face, u, v) coordinates to a direction vector (not necessarily unit length).static S2PointS2Projections.faceUvToXyz(int face, R2Vector uv) Convert (face, u, v) coordinates to a direction vector (not necessarily unit length).static S2PointS2Projections.faceXyzToUvw(int face, S2Point p) Returns the given point P transformed to the (u,v,w) coordinate frame of the given face (where the w-axis represents the face normal).S2Cell.getCenter()Return the direction vector corresponding to the center in (s,t)-space of the given cell.S2PaddedCell.getCenter()Returns the center of this cell.S2Cell.getCenterRaw()S2AreaCentroid.getCentroid()final S2PointS2LatLngRectBase.getCentroid()S2Loop.getCentroid()Returns the true centroid of the loop multiplied by the area of the loop, or null if this loop is empty, full, or invalid.S2Polygon.getCentroid()Returns the true centroid of the polygon, weighted by the area of the polygon (see s2.h for details on centroids).S2Edge.getChainVertex(int chainId, int edgeOffset) S2Loop.getChainVertex(int chainId, int edgeOffset) S2Point.Shape.getChainVertex(int chainId, int edgeOffset) S2Polygon.Shape.getChainVertex(int chainId, int edgeOffset) S2Polyline.getChainVertex(int chainId, int edgeOffset) S2Shape.getChainVertex(int chainId, int edgeOffset) Returns the start point of the edge that would be returned byS2Shape.getChainEdge(int, int, S2Shape.MutableEdge), or the endpoint of the last edge ifedgeOffset==getChainLength(chainId).static S2PointS2EdgeUtil.getClosestPoint(S2Point x, S2Point a, S2Point b) Returns the point on edge AB closest to X.static S2PointS2EdgeUtil.getClosestPoint(S2Point x, S2Point a, S2Point b, S2Point aCrossB) AsS2EdgeUtil.getClosestPoint(S2Point, S2Point, S2Point), but faster if the cross product between a and b has already been computed.S2Cell.getEdge(int k) AsS2Cell.getEdgeRaw(int), except the point is normalized to unit length.S2Cell.getEdgeRaw(int k) Returns the inward-facing normal of the great circle passing through the edge from vertex k to vertex k+1 (mod 4).S2Edge.getEnd()S2Shape.MutableEdge.getEnd()Returns the trailing point of the last edge retrieved viaS2Shape.getEdge(int, MutableEdge), or null if no edge has been retrieved.S2PaddedCell.getEntryVertex()Returns the vertex where the S2 space-filling curve enters this cell.S2PaddedCell.getExitVertex()Returns the vertex where the S2 space-filling curve exits this cell.static S2PointS2EdgeUtil.getIntersection(S2Point a0, S2Point a1, S2Point b0, S2Point b1) Given two edges AB and CD such that robustCrossing() is true, return their intersection point.static S2PointS2Projections.getNorm(int face) Returns the unit-length normal for the given face.ParametrizedS2Point.getPoint()S2PointRegion.getPoint()S2Edge.getStart()S2Shape.MutableEdge.getStart()Returns the leading point of the last edge retrieved viaS2Shape.getEdge(int, MutableEdge), or null if no edge has been retrieved.static S2PointS2Projections.getUAxis(int face) Returns the u-axis for the given face.static S2PointS2Projections.getUNorm(int face, double u) Returns the right-handed normal (not necessarily unit length) for an edge in the direction of the positive v-axis at the given u-value on the given face.static S2PointS2Projections.getVAxis(int face) Returns the v-axis for the given face.S2Cell.getVertex(int k) AsS2Cell.getVertexRaw(int), except the point is normalized to unit length.S2Cell.getVertexRaw(int k) Returns the kth vertex of the cell (k = 0,1,2,3).static S2PointS2Projections.getVNorm(int face, double v) Returns the right-handed normal (not necessarily unit length) for an edge in the direction of the positive u-axis at the given v-value on the given face.static S2PointS2EdgeUtil.interpolate(double t, S2Point a, S2Point b) Return the point X along the line segment AB whose distance from A is the given fraction "t" of the distance AB.S2Polyline.interpolate(double fraction) Return the point whose distance from vertex 0 along the polyline is the given fraction of the polyline's total length.static S2PointS2EdgeUtil.interpolateAtDistance(S1Angle ax, S2Point a, S2Point b) LikeS2EdgeUtil.interpolate(double, S2Point, S2Point), except that the parameter "ax" represents the desired distance from A to the result X rather than a fraction between 0 and 1.static S2PointS2EdgeUtil.interpolateAtDistance(S1Angle ax, S2Point a, S2Point b, S1Angle ab) A slightly more efficient version ofS2EdgeUtil.interpolateAtDistance(S1Angle, S2Point, S2Point, S1Angle)that can be used when the distance AB is already known.static S2PointAs above, but do not CHECK-fail on invalid input.static S2PointS2TextFormat.makePointOrDie(String str) Returns an S2Point corresponding to the given a latitude-longitude coordinate in degrees.static final S2PointReturns sub(this,p).S2Point.mul(double scale) Returns mul(this,scale).static final S2PointReturns the component-wise multiplication of 'p' with 'm'.S2Point.neg()Returns neg(this).static final S2PointReturns the component-wise negation of 'p', i.e. its antipodal point.S2Point.normalize()Returns normalize(this).static final S2PointReturns a copy of 'p' rescaled to be unit-length.S2Loop.orientedVertex(int i) Like vertex(), but this method returns vertices in reverse order if the loop represents a polygon hole.static S2PointS2.origin()Return a unique "origin" on the sphere for operations that need a fixed reference point.static S2PointReturns a unit-length vector that is orthogonal toa.final S2PointS2Point.ortho()return a vector orthogonal to this onestatic S2PointS2.planarCentroid(S2Point a, S2Point b, S2Point c) Return the centroid of the planar triangle ABC.S2PointIndex.Entry.point()Returns a point on the polygon that is closest to point P.Returns the point on the polyline closest toqueryPoint.S2Polyline.projectToEdge(S2Point point, int index) Given a point p and the index of the start point of an edge of this polyline, returns the point on that edge that is closest to p.static S2PointS2.robustCrossProd(S2Point a, S2Point b) Return a vector "c" that is orthogonal to the given unit-length vectors "a" and "b".Rotates this point around an arbitrary axis.Returns sub(this,p).static final S2PointReturns the component-wise subtraction of 'p1' and 'p2'.S2CellId.toPoint()S2LatLng.toPoint()Convert an S2LatLng to the equivalent unit-length vector (S2Point).S2CellId.toPointRaw()Return the direction vector corresponding to the center of the given cell.static S2PointS2.trueCentroid(S2Point a, S2Point b) Returns the true centroid of the spherical geodesic edge AB multiplied by the length of the edge AB.static S2PointS2.trueCentroid(S2Point a, S2Point b, S2Point c) Returns the true centroid of the spherical triangle ABC multiplied by the signed area of spherical triangle ABC.S2ShapeUtil.CentroidMeasure.value()Returns the centroid.S2LaxPolygonShape.MultiList.vertex(int vertexId) S2LaxPolygonShape.SimpleList.vertex(int vertexId) S2LaxPolylineShape.SimpleList.vertex(int vertexId) S2Loop.vertex(int i) For convenience, we make two entire copies of the vertex list available: vertex(n..2*n-1) is mapped to vertex(0..n-1), where n == numVertices().S2Polyline.vertex(int k) Methods in com.google.common.geometry that return types with arguments of type S2PointModifier and TypeMethodDescriptionS2Shape.chain(int chain) Returns a view of the vertices in the given chain.S2Shape.chains()Returns a view of thechainsin this shape.S2PointCompression.decodePointsCompressed(int numVertices, int level, InputStream input) Decode a list of points that were encoded usingS2PointCompression.encodePointsCompressed(List, int, OutputStream).S2Loop.makeRegularVertices(S2Point center, S1Angle radius, int numVertices) AsS2Loop.makeRegularLoop(S2Point, S1Angle, int), but returns vertices as a list.S2FractalBuilder.makeVertices(com.google.common.geometry.Matrix3x3 frame, S1Angle nominalRadius) AsS2FractalBuilder.makeLoop(Matrix3x3, S1Angle)except it returns the vertices instead of loop.S2Loop.orientedVertices()Returns the vertices oriented such that left is on the inside.S2TextFormat.parsePoints(String str) As above, but does not CHECK-fail on invalid input.S2TextFormat.parsePointsOrDie(String str) Parses a string in the same format as parseLatLngs, and return the corresponding List of S2Point values.S2Loop.vertices()Returns an unmodifiable view of the vertices of this polyline.S2Polyline.vertices()Returns an unmodifiable view of the vertices of this polyline.Methods in com.google.common.geometry with parameters of type S2PointModifier and TypeMethodDescriptionvoidvoidvoidvoidReturns add(this,p).static final S2PointReturns the component-wise addition of 'p1' and 'p2'.Adds point.voidAsS2PointIndex.add(Entry), but more convenient.booleanAdds the given edge to the polygon builder and returns true if the edge was actually added to the edge graph.voidS2EdgeUtil.XYZPruner.addEdgeToBounds(S2Point from, S2Point to) Accumulate a bounding rectangle from provided edges.voidS2ContainsVertexQuery.addIncoming(S2Point v) Adds an edge from 'v' incoming to 'target'.voidS2ContainsVertexQuery.addOutgoing(S2Point v) Adds an edge outgoing from 'target' to 'v'.Increase the cap radius if necessary to include the given point.voidAdds a point to the input geometry.voidThis method is called to add each vertex to the chain.Returns a new rectangle that includes this rectangle and the given point, expanding this rectangle to include the point by the minimum amount possible.static doubleReturn the angle at the vertex B in the triangle ABC.final doubleReturn the angle between two vectors in radiansstatic booleanS2.approxEquals(S2Point a, S2Point b) static booleanS2.approxEquals(S2Point a, S2Point b, double maxError) Return true if two points are within the given distance of each other (mainly useful for testing).static doubleReturns the area of triangle ABC.final booleanS2LatLngRectBase.boundaryIntersects(S2Point v0, S2Point v1) Returns true if the boundary of this rectangle intersects the given geodesic edge (v0, v1).voidS2EdgeIndex.clipEdge(S2Point a0, S2Point a1, boolean addSharedEdges, Collection<ParametrizedS2Point> intersections) Adds points where the edge index intersects the edge[a0, a1]tointersections.static booleanS2EdgeUtil.clipToFace(S2Point a, S2Point b, int face, R2Vector aUv, R2Vector bUv) Given an edge AB and a face, return the (u,v) coordinates for the portion of AB that intersects that face.static booleanS2EdgeUtil.clipToPaddedFace(S2Point aXyz, S2Point bXyz, int face, double padding, R2Vector aUv, R2Vector bUv) AsS2EdgeUtil.clipToFace(S2Point, S2Point, int, R2Vector, R2Vector), but rather than clipping to the square [-1,1]x[-1,1] in (u,v) space, this method clips to [-R,R]x[-R,R] where R=(1+padding).static intS2Predicates.compareDistances(S2Point x, S2Point a, S2Point b) Returns -1, 0, or +1 according to whether AX invalid input: '<' BX, A == B, or AX > BX respectively.static intS2Predicates.compareEdgeDistance(S2Point x, S2Point a, S2Point b, double r2) Returns -1, 0, or +1 according to whether the distance from the point X to the edge AB is less than, equal to, or greater than the squared chord distance "r2" respectively.intbooleanbooleanbooleanThe point 'p' does not need to be normalized.booleanReturns true if any shape in the given iterator containspunder the specifiedS2ContainsPointQuery.S2VertexModel.final booleanThe point 'p' does not need to be normalized.booleanReturns true if the point is contained by the loop.booleanbooleanbooleanThe pointpdoes not need to be normalized.booleanbooleanReturns true if and only if the given point is contained by the region.booleanReturns true if all the regions fully contain the point.booleanOnly returns true if one of the regions contains the point.booleanReturns true if the given point is contained by any two-dimensional shape (i.e., polygon).static booleanS2ShapeUtil.containsBruteForce(S2Shape shape, S2Point point) Returns true if the given shape contains the given point.static S2Shape.ReferencePointCreates a referenced point at position 'p', with known containment 'contained'.static <Data> S2PointIndex.Entry<Data> S2PointIndex.createEntry(S2Point point, Data data) Convenience method to create an index entry from the given point and data value.Returns crossProd(this,p).static final S2PointReturns the R3 vector cross product of 'p1' and 'p2'.final doubleS2Point.crossProdNorm(S2Point va) Returns the norm of the cross product,S2Point.crossProd(this, va).norm().static final S2PointReturns the component-wise division of 'p' by 'm'.final doubleReturns the vector dot product of 'this' with 'that'.static intReturns sign(P, Q, Z) where Z is the circumcenter of triangle ABC.booleanS2EdgeUtil.EdgeCrosser.edgeOrVertexCrossing(S2Point d) This method is equivalent to theS2EdgeUtil.EdgeCrosser.edgeOrVertexCrossing(S2Point)method defined below.booleanS2EdgeUtil.EdgeCrosser.edgeOrVertexCrossing(S2Point c, S2Point d) AsS2EdgeUtil.EdgeCrosser.edgeOrVertexCrossing(S2Point), but restarts atcif that is not the previous endpoint.static booleanS2EdgeUtil.edgeOrVertexCrossing(S2Point a, S2Point b, S2Point c, S2Point d) A convenience function that calls robustCrossing() to handle cases where all four vertices are distinct, and VertexCrossing() to handle cases where two or more vertices are the same.booleanS2Point.equalsPoint(S2Point that) Returns true if this point is equal tothat.static intComputes the determinant using exact arithmetic and/or symbolic permutations.static intReturns the sign of the determinant using more expensive techniques.static final S2PointReturns the component-wise absolute point from 'p'.static R2VectorS2Projections.faceXyzToUv(int face, S2Point p) If the dot product of p with the given face normal is positive, set the corresponding u and v values (which may lie outside the range [-1,1]) and return true.static S2PointS2Projections.faceXyzToUvw(int face, S2Point p) Returns the given point P transformed to the (u,v,w) coordinate frame of the given face (where the w-axis represents the face normal).protected voidS2EdgeIndex.findCandidateCrossings(S2Point a, S2Point b, List<Integer> candidateCrossings) Appends to "candidateCrossings" all edge references which may cross the given edge.S2ClosestPointQuery.findClosestPoint(S2Point target) Convenience method that returns the closest point to the given target point, or null if no points satisfy theS2ClosestPointQuery.getMaxDistance()andS2ClosestPointQuery.getRegion()criteria.S2ClosestPointQuery.findClosestPoints(S2Point target) Returns the closest points totargetthat satisfy theS2ClosestPointQuery.getMaxDistance(),S2ClosestPointQuery.getMaxPoints(), andS2ClosestPointQuery.getRegion()criteria, ordered by increasing distance.voidS2ClosestPointQuery.findClosestPoints(List<S2ClosestPointQuery.Result<T>> results, S2Point target) AsS2ClosestPointQuery.findClosestPoints(S2Point), but sorts the results and adds them at the end of the given list.S2ClosestPointQuery.findClosestPointsToEdge(S2Point a, S2Point b) Returns the closest points to the given edge AB.voidS2ClosestPointQuery.findClosestPointsToEdge(List<S2ClosestPointQuery.Result<T>> results, S2Point a, S2Point b) AsS2ClosestPointQuery.findClosestPointsToEdge(S2Point, S2Point), but adds results to the given list.static S2CapS2Cap.fromAxisAngle(S2Point axis, S1Angle angle) Create a cap given its axis and the cap opening angle, i.e. maximum angle between the axis and a point on the cap.static S2CapS2Cap.fromAxisArea(S2Point axis, double area) Create a cap given its axis and its area in steradians.static S2CapS2Cap.fromAxisChord(S2Point center, S1ChordAngle radius) Creates a cap where the radius is expressed as an S1ChordAngle.static S2CapS2Cap.fromAxisHeight(S2Point axis, double height) Create a cap given its axis and the cap height, i.e. the maximum projected distance along the cap axis from the cap center.static S2LatLngRectReturns a latitude-longitude rectangle that contains the edge from "a" to "b".static S2CellIdReturn the leaf cell containing the given point (a direction vector, not necessarily unit length).S2Cell.getBoundaryDistance(S2Point target) Returns the distance from the cell boundary to the given point.voidS2EdgeIndex.DataEdgeIterator.getCandidates(S2Point a, S2Point b) Initializes the iterator to iterate over a set of candidates that may cross the edge (a,b).S2EdgeQuery.getCandidates(S2Point a, S2Point b) Given a query edge AB, returns a map from the indexed shapes to a superset of the edges for each shape that intersect AB.S2EdgeQuery.getCandidates(S2Point a, S2Point b, S2Shape shape) Given a query edge AB and a shapeshape, returns a superset of the edges ofshapethat intersect AB.booleanS2EdgeQuery.getCells(S2Point a, S2Point b, S2PaddedCell root, List<S2ShapeIndex.Cell> cells) Convenience method for callingS2EdgeQuery.getCells(S2Point, R2Vector, S2Point, R2Vector, S2PaddedCell, List).static S2PointS2EdgeUtil.getClosestPoint(S2Point x, S2Point a, S2Point b) Returns the point on edge AB closest to X.static S2PointS2EdgeUtil.getClosestPoint(S2Point x, S2Point a, S2Point b, S2Point aCrossB) AsS2EdgeUtil.getClosestPoint(S2Point, S2Point, S2Point), but faster if the cross product between a and b has already been computed.S2ContainsPointQuery.getContainingShapes(S2Point p) A convenience function that returns all the shapes that containp.S2EdgeQuery.getCrossings(S2Point a, S2Point b) Returns edges for each shape that either crosses AB or shares a vertex with AB.S2EdgeQuery.getCrossings(S2Point a, S2Point b, S2Shape shape) Returns edges from a given shape that either cross AB or share a vertex with AB.S2Cell.getDistance(S2Point targetXyz) Returns the distance from the given point to the cell.static S1ChordAngleS2EdgeUtil.getDistance(S2Point p, S2Edge e) Gets the distance fromptoe.static S1AngleS2EdgeUtil.getDistance(S2Point x, S2Point a, S2Point b) Return the minimum distance from X to any point on the edge AB.static S1AngleS2EdgeUtil.getDistance(S2Point x, S2Point a, S2Point b, S2Point aCrossB) A slightly more efficient version of getDistance() where the cross product of the two endpoints has been precomputed.S2Loop.getDistance(S2Point p) Returns the shortest distance from a point P to this loop, given as the angle formed between P, the origin and the nearest point on the loop to P.doubleS2Point.getDistance(S2Point that) Returns the distance in 3D coordinates from this to that.S2Polygon.getDistance(S2Point p) Returns the shortest distance from a point P to this polygon, given as the angle formed between P, the origin, and the nearest point on the polygon to P.doubleS2Point.getDistance2(S2Point that) Returns the square of the distance in 3D coordinates from this to that.static doubleS2EdgeUtil.getDistanceFraction(S2Point x, S2Point a0, S2Point a1) Given a point X and an edge AB, return the distance ratio AX / (AX + BX).static doubleS2EdgeUtil.getDistanceRadians(S2Point x, S2Point a, S2Point b, S2Point aCrossB) A more efficient version of getDistance() where the cross product of the endpoints has been precomputed and the result is returned as a direct radian measure rather than wrapping it in an S1Angle.S2Cell.getDistanceToEdge(S2Point a, S2Point b) Returns the minimum distance from the cell to the given edge AB, or zero if the edge intersects the cell interior.static S1ChordAngleS2EdgeUtil.getEdgePairDistance(S2Point a0, S2Point a1, S2Point b0, S2Point b1) Gets distance between edges with no minimum distance.static S1ChordAngleS2EdgeUtil.getEdgePairMaxDistance(S2Point a0, S2Point a1, S2Point b0, S2Point b1, S1ChordAngle maxDist) LikeS2EdgeUtil.updateMaxDistance(S2Point, S2Point, S2Point, S1ChordAngle), but computes the maximum distance between the given pair of edges.static S1ChordAngleS2EdgeUtil.getEdgePairMinDistance(S2Point a0, S2Point a1, S2Point b0, S2Point b1, S1ChordAngle minDist) LikeS2EdgeUtil.updateMinDistance(S2Point, S2Edge, S1ChordAngle), but computes the minimum distance between the given pair of edges.static com.google.common.geometry.Matrix3x3Returns a right-handed coordinate frame (three orthonormal vectors) based on a single point, which will become the third axis.static S2PointS2EdgeUtil.getIntersection(S2Point a0, S2Point a1, S2Point b0, S2Point b1) Given two edges AB and CD such that robustCrossing() is true, return their intersection point.S2Cell.getMaxDistance(S2Point target) Returns the maximum distance from the cell (including its interior) to the given point.S2Cell.getMaxDistance(S2Point a, S2Point b) Returns the maximum distance from the cell (including its interior) to the given edge AB.intS2Polyline.getNearestEdgeIndex(S2Point point) Given a point, returns the index of the start point of the (first) edge on the polyline that is closest to the given point.static voidS2RegionCoverer.getSimpleCovering(S2Region region, S2Point start, int level, ArrayList<S2CellId> output) Given a connected region and a starting point, return a set of cells at the given level that cover the region.static S2Predicates.ExcludedS2Predicates.getVoronoiSiteExclusion(S2Point a, S2Point b, S2Point p, S2Point q, double r2) This is a specialized method that is used to compute the intersection of an edge PQ with the Voronoi diagram of a set of points, where each Voronoi region is intersected with a disc of fixed radius "r".static com.google.common.geometry.S2EdgeUtil.WedgeRelationReturns the relation from wedge A to B.static doubleS2.girardArea(S2Point a, S2Point b, S2Point c) Returns the area of the triangle computed using Girard's formula.booleanReturns true if the given directed edge [v0 -> v1] is present in the directed edge graph.voidbooleanS2Cap.interiorContains(S2Point p) Return true if and only if the given point is contained in the interior of the region (i.e. the region excluding its boundary).final booleanS2LatLngRectBase.interiorContains(S2Point p) Returns true if and only if the given point is contained in the interior of the region (i.e. the region excluding its boundary).static S2PointS2EdgeUtil.interpolate(double t, S2Point a, S2Point b) Return the point X along the line segment AB whose distance from A is the given fraction "t" of the distance AB.static S2PointS2EdgeUtil.interpolateAtDistance(S1Angle ax, S2Point a, S2Point b) LikeS2EdgeUtil.interpolate(double, S2Point, S2Point), except that the parameter "ax" represents the desired distance from A to the result X rather than a fraction between 0 and 1.static S2PointS2EdgeUtil.interpolateAtDistance(S1Angle ax, S2Point a, S2Point b, S1Angle ab) A slightly more efficient version ofS2EdgeUtil.interpolateAtDistance(S1Angle, S2Point, S2Point, S1Angle)that can be used when the distance AB is already known.booleanS2Cap.intersects(S2Cell cell, S2Point[] vertices) Return true if the cap intersects 'cell', given that the cap vertices have already been checked.booleanS2EdgeUtil.LongitudePruner.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'.booleanS2EdgeUtil.XYZPruner.intersects(S2Point v1) Returns true if the edge going from the last point to this point passes through the pruner bounding box, otherwise returns false.static final booleanS2LatLngRectBase.intersectsLatEdge(S2Point a, S2Point b, double lat, S1Interval lng) Returns true if the edge AB intersects the given edge of constant latitude.static final booleanS2LatLngRectBase.intersectsLngEdge(S2Point a, S2Point b, R1Interval lat, double lng) Returns true if the edge AB intersects the given edge of constant longitude.booleanS2Shape.MutableEdge.isEndpoint(S2Point point) Returns true iff 'point' is either endpoint of this edge.static booleanS2.isUnitLength(S2Point p) Return true if the given point is approximately unit length (this is mainly useful for assertions).static S1Anglestatic final booleanS2EdgeUtil.lenientCrossing(S2Point a, S2Point b, S2Point c, S2Point d) Returns true if ab possibly crosses cd, by clipping tiny angles to zero.booleanbooleanPositions the iterator at the index cell containing "target" and returns true, or if no such cell exists in the index, the iterator is positioned arbitrarily and this method returns false.static S1Anglestatic S2LoopS2Loop.makeRegularLoop(S2Point center, S1Angle radius, int numVertices) Create a circle of points with a given center, radius, and number of vertices.S2Loop.makeRegularVertices(S2Point center, S1Angle radius, int numVertices) AsS2Loop.makeRegularLoop(S2Point, S1Angle, int), but returns vertices as a list.static final S2PointReturns sub(this,p).static final S2PointReturns the component-wise multiplication of 'p' with 'm'.static final S2PointReturns the component-wise negation of 'p', i.e. its antipodal point.static final S2PointReturns a copy of 'p' rescaled to be unit-length.static booleanS2Predicates.orderedCCW(S2Point a, S2Point b, S2Point c, S2Point o) Return true if the edges OA, OB, and OC are encountered in that order while sweeping CCW around the point O.static S2PointReturns a unit-length vector that is orthogonal toa.static S2PointS2.planarCentroid(S2Point a, S2Point b, S2Point c) Return the centroid of the planar triangle ABC.Returns a point on the polygon that is closest to point P.Returns the point on the polyline closest toqueryPoint.S2Polyline.projectToEdge(S2Point point, int index) Given a point p and the index of the start point of an edge of this polyline, returns the point on that edge that is closest to p.booleanAsS2PointIndex.remove(Entry), but more convenient.voidCall this method when your chain 'jumps' to a new place.intS2EdgeUtil.EdgeCrosser.robustCrossing(S2Point d) This method is equivalent to calling theS2EdgeUtil.EdgeCrosser.robustCrossing(S2Point)function (defined below) on the edges AB and CD.intS2EdgeUtil.EdgeCrosser.robustCrossing(S2Point c, S2Point d) AsS2EdgeUtil.EdgeCrosser.robustCrossing(S2Point), but restarts atcif that is not the previous endpoint.static intS2EdgeUtil.robustCrossing(S2Point a, S2Point b, S2Point c, S2Point d) Like SimpleCrossing, except that points that lie exactly on a line are arbitrarily classified as being on one side or the other (according to the rules of sign).static S2PointS2.robustCrossProd(S2Point a, S2Point b) Return a vector "c" that is orthogonal to the given unit-length vectors "a" and "b".Rotates this point around an arbitrary axis.static final doubleS2Point.scalarTripleProduct(S2Point a, S2Point b, S2Point c) Returns the scalar triple product,a.dotProd(b.crossProd(c)).voidCalled by implementations ofS2Shape.getEdge(int, MutableEdge)to update the endpoints of this mutable edge to the given values.voidS2EdgeUtil.XYZPruner.setFirstIntersectPoint(S2Point v0) booleanS2ContainsPointQuery.S2VertexModel.shapeContains(S2Point cellCenter, S2ShapeIndex.S2ClippedShape clipped, S2Point p) Returns true if the clipped portion of a shape 'clipped' from a cell with center 'cellCenter' contains the point 'p' according to this vertex model.booleanS2ContainsPointQuery.shapeContains(S2Shape shape, S2Point p) Returns true if the given shape containspunder the specifiedS2ContainsPointQuery.S2VertexModel.static intReturns +1 if the points A, B, C are counterclockwise, -1 if the points are clockwise, and 0 if any two points are the same.static intReturns the sign of the turn ABC.static doubleS2.signedArea(S2Point a, S2Point b, S2Point c) Like area(), but returns a positive value for counterclockwise triangles and a negative value otherwise.static booleanS2.simpleCrossing(S2Point a, S2Point b, S2Point c, S2Point d) Return true if edge AB crosses CD at a point that is interior to both edges.static booleanS2EdgeUtil.simpleCrossing(S2Point a, S2Point b, S2Point c, S2Point d) Return true if edge AB crosses CD at a point that is interior to both edges.static S2Point.Shapestatic intCompute the determinant in a numerically stable way.Returns sub(this,p).static final S2PointReturns the component-wise subtraction of 'p1' and 'p2'.intGiven two edge chains, this function returns +1 if the region to the left of A contains the region to the left of B, and 0 otherwise.intGiven two edge chains (see WedgeRelation above), this function returns +1 if A contains B, 0 if B contains A or the two wedges do not intersect, and -1 if the edge chains A and B cross each other (i.e. if A intersects both the interior and exterior of the region to the left of B).intS2EdgeUtil.WedgeContainsOrIntersects.test(S2Point a0, S2Point ab1, S2Point a2, S2Point b0, S2Point b2) Given two edge chains (see WedgeRelation above), this function returns +1 if A contains B, 0 if A and B are disjoint, and -1 if A intersects but does not contain B.intGiven two edge chains (see WedgeRelation above), this function returns -1 if the region to the left of A intersects the region to the left of B, and 0 otherwise.intA wedge processor's test method accepts two edge chains A=(a0,a1,a2) and B=(b0,b1,b2) where a1==b1, and returns either -1, 0, or 1 to indicate the relationship between the region to the left of A and the region to the left of B.static StringConvert an S2Point to the S2TextFormat string representation documented above.static intThis version of Sign returns +1 if the points are definitely CCW, -1 if they are definitely CW, and 0 if two points are identical or the result is uncertain.static S2PointS2.trueCentroid(S2Point a, S2Point b) Returns the true centroid of the spherical geodesic edge AB multiplied by the length of the edge AB.static S2PointS2.trueCentroid(S2Point a, S2Point b, S2Point c) Returns the true centroid of the spherical triangle ABC multiplied by the signed area of spherical triangle ABC.static doubleReturns the exterior angle at the vertex B in the triangle ABC.doubleS2Polyline.uninterpolate(S2Point queryPoint) Projects the query point to the nearest part of the polyline, and returns the fraction of the polyline's total length traveled along the polyline from vertex 0 to the projected point.static S1ChordAngleS2EdgeUtil.updateMaxDistance(S2Point x, S2Point a, S2Point b, S1ChordAngle maxDistance) Returns the maximum of the distance fromxto any point on edge AB and the givenmaxDistance.static S1ChordAngleS2EdgeUtil.updateMinDistance(S2Point p, S2Edge e, S1ChordAngle minDistance) Gets the minimum of the distance fromatoeandminDistance.static S1ChordAngleS2EdgeUtil.updateMinDistance(S2Point x, S2Point a, S2Point b, S1ChordAngle minDistance) Return the minimum of the distance fromxto any point on edge ab and the givenminDistance.static R2VectorS2Projections.validFaceXyzToUv(int face, S2Point p) Given a *valid* face for the given point p (meaning that dot product of p with the face normal is positive), return the corresponding u and v values (which may lie outside the range [-1,1]).static booleanS2EdgeUtil.vertexCrossing(S2Point a, S2Point b, S2Point c, S2Point d) Given two edges AB and CD where at least two vertices are identical (i.e. robustCrossing(a,b,c,d) == 0), this function defines whether the two edges "cross" in a such a way that point-in-polygon containment tests can be implemented by counting the number of edge crossings.static intReturns the face containing the given direction vector (for points on the boundary between faces, the result is arbitrary but repeatable.)final doubleReturns the 'u' coordinate of the [u, v] point projected onto a cube face from the given [x, y, z] position.final doubleReturns the 'v' coordinate of the [u, v] point projected onto a cube face from the given [x, y, z] position.Method parameters in com.google.common.geometry with type arguments of type S2PointModifier and TypeMethodDescriptionstatic S2LaxPolygonShapeCreates a polygon from the given loops, defensively copying any loop's Iterable except anImmutableList, to ensure the polygon is deeply immutable.static S2LaxPolylineShapeCreates a new lax polyline from the given vertices.static S2LaxPolylineShapeS2LaxPolylineShape.createMulti(Iterable<? extends Iterable<S2Point>> lines) Creates a new lax multipolyline with the given lines.static S2LaxPolylineShapeS2LaxPolylineShape.createMultiPacked(Iterable<? extends Iterable<S2Point>> lines) AsS2LaxPolylineShape.create(S2Polyline), but with coordinates packed into a double[].static S2LaxPolygonShapeS2LaxPolygonShape.createPacked(Iterable<? extends Iterable<S2Point>> loops) AsS2LaxPolygonShape.create(S2Polygon), but packs coordinates into a double[] array.static S2LaxPolylineShapeS2LaxPolylineShape.createPacked(Iterable<S2Point> vertices) AsS2LaxPolylineShape.create(S2Polyline), but with coordinates packed into a double[].static voidS2PointCompression.encodePointsCompressed(List<S2Point> points, int level, OutputStream output) Encode a list of points into an efficient, lossless binary representation, which can be decoded by callingS2PointCompression.decodePointsCompressed(int, int, InputStream).static S2Point.Shapestatic booleanStatic version of isValid(), to be used only when an S2Loop instance is not available, but validity of the points must be checked.booleanReturn true if the given vertices form a valid polyline.static S2LoopS2Loop.newLoopWithTrustedDetails(List<S2Point> vertices, boolean originInside, S2LatLngRect bound) Fast/unsafe loop initialization.static StringS2TextFormat.s2PointsToString(List<S2Point> points) Convert a list of S2Points to the S2TextFormat string representation documented above.Returns a simplified loop, which may be self-intersecting, or null if the entire loop was within the tolerance.static voidS2ShapeUtil.visitSurfaceIntegral(List<S2Point> vertices, S2ShapeUtil.TriangleConsumer consumer) Visits the surface integral of the vertices, that is, a collection of oriented triangles, possibly overlapping.Constructors in com.google.common.geometry with parameters of type S2PointModifierConstructorDescriptionEdgeCrosser(S2Point a, S2Point b) Convenience constructor that calls init() with the given fixed edge AB.EdgeCrosser(S2Point a, S2Point b, S2Point c) AB is the given fixed edge, and C is the first vertex of the vertex chain.LongitudePruner(S1Interval interval, S2Point v0) 'interval' is the longitude interval to be tested against, and 'v0' is the first vertex of edge chain.ParametrizedS2Point(double time, S2Point point) Return the angle between two points, which is also equal to the distance between these points on the unit sphere.S1ChordAngle(S2Point x, S2Point y) Constructs the S1ChordAngle corresponding to the distance between the two given points.S2AreaCentroid(double area, S2Point centroid) S2ContainsVertexQuery(S2Point target) Creates a contains vertex query to determine containment of 'target'.Convert a point (not necessarily normalized) to an S2LatLng.S2PointRegion(S2Point point) Constructor parameters in com.google.common.geometry with type arguments of type S2Point