static R2Vector |
R2Vector.add(R2Vector p1,
R2Vector p2) |
Returns the vector result of p1 - p2 .
|
void |
R2Rect.addPoint(R2Vector p) |
Increase the size of the bounding rectangle to include the given point.
|
R2Vector |
R2Rect.clampPoint(R2Vector p) |
Return the closest point in this rectangle to the given point "p".
|
(package private) static int |
S2EdgeUtil.clipDestination(S2Point a,
S2Point b,
S2Point nScaled,
S2Point aTangent,
S2Point bTangent,
double uvScale,
R2Vector uv) |
This helper function does two things.
|
(package private) static boolean |
S2EdgeUtil.clipEdge(R2Vector a,
R2Vector b,
R2Rect clip,
R2Vector aClipped,
R2Vector bClipped) |
Given an edge AB, assigns the portion of AB that is contained by the given rectangle "clip" to
the aClipped and bClipped arguments, and returns true if there is an intersection.
|
(package private) static boolean |
S2EdgeUtil.clipEdgeBound(R2Vector a,
R2Vector b,
R2Rect clip,
R2Rect bound) |
This function can be used to clip an edge AB to sequence of rectangles efficiently.
|
static boolean |
S2EdgeUtil.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 boolean |
S2EdgeUtil.clipToPaddedFace(S2Point aXyz,
S2Point bXyz,
int face,
double padding,
R2Vector aUv,
R2Vector bUv) |
As S2EdgeUtil.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).
|
private void |
S2EdgeQuery.clipVAxis(R2Rect edgeBound,
double center,
int i,
S2PaddedCell pCell,
R2Vector aVector,
R2Vector bVector) |
Given either the left (i = 0) or right (i = 1) side of a padded cell pCell , determines
whether the current edge intersects the lower child, upper child, or both children, and calls
getCells() recursively on those children.
|
boolean |
R2Rect.contains(R2Vector p) |
Returns true if this rectangle contains the given point.
|
double |
R2Vector.crossProd(R2Vector that) |
Returns the cross product of this vector with that vector.
|
double |
R2Vector.dotProd(R2Vector that) |
Returns the dot product of this vector with that vector.
|
static double |
R2Vector.dotProd(R2Vector p1,
R2Vector p2) |
Returns the dot product of the given vectors.
|
R2Rect |
R2Rect.expanded(R2Vector margin) |
Return a rectangle that has been expanded on each side in the x-direction by margin.x(), and on
each side in the y-direction by margin.y().
|
static S2Point |
S2Projections.faceUvToXyz(int face,
R2Vector uv) |
Convert (face, u, v) coordinates to a direction vector (not necessarily unit length).
|
static R2Rect |
R2Rect.fromCenterSize(R2Vector center,
R2Vector size) |
Returns a new rectangle from a center point and size in each dimension.
|
static R2Rect |
R2Rect.fromPoint(R2Vector p) |
Returns a rectangle containing a single point.
|
static R2Rect |
R2Rect.fromPointPair(R2Vector p1,
R2Vector p2) |
Returns the minimal bounding rectangle containing the two given points.
|
private void |
S2EdgeQuery.getCells(S2PaddedCell pCell,
R2Rect edgeBound,
R2Vector aVector,
R2Vector bVector) |
Computes the index cells intersected by the current edge that are descendants of pCell ,
and adds them to cells .
|
(package private) boolean |
S2EdgeQuery.getCells(S2Point a,
R2Vector aVector,
S2Point b,
R2Vector bVector,
S2PaddedCell root,
java.util.List<S2ShapeIndex.Cell> cells) |
Adds all cells to cells that might intersect the query edge from a to b
and the cell root .
|
(package private) static R2Rect |
S2EdgeUtil.getClippedEdgeBound(R2Vector a,
R2Vector b,
R2Rect clip) |
Given an edge AB and a rectangle "clip", return the bounding rectangle of the portion of AB
intersected by "clip".
|
(package private) static void |
S2EdgeUtil.getExitPoint(S2Point n,
int axis,
R2Vector result) |
Given a cube face F, a directed line L (represented by its CCW normal N in the (u,v,w)
coordinates of F), and result of S2EdgeUtil.getExitAxis(S2Point) , set result to the (u,v)
coordinates of the point where L exits the cube face.
|
(package private) static int |
S2EdgeUtil.getNextFace(int face,
R2Vector exit,
int axis,
S2Point n,
int targetFace) |
Return the next face that should be visited by getFaceSegments, given that we have just visited
"face" and we are following the line AB (represented by its normal N in the (u,v,w) coordinates
of that face).
|
private void |
S2FractalBuilder.getR2VerticesHelper(R2Vector v0,
R2Vector v4,
int level,
java.util.List<R2Vector> vertices) |
Given the two endpoints (v0, v4) of an edge, recursively subdivide the edge to the desired
level, and insert all vertices of the resulting curve up to but not including the endpoint
"v4".
|
boolean |
R2Rect.interiorContains(R2Vector p) |
Returns true if and only if the given point is contained in the interior of the region (i.e.
|
(package private) static boolean |
S2EdgeUtil.intersectsRect(R2Vector a,
R2Vector b,
R2Rect rect) |
Returns true if the edge AB intersects the given (closed) rectangle to within the error bound
below.
|
boolean |
R2Vector.lessThan(R2Vector that) |
Returns true if this vector is less than that vector, with the x-axis as the primary sort key
and the y-axis as the secondary sort key.
|
(package private) static int |
S2EdgeUtil.moveOriginToValidFace(int face,
S2Point a,
S2Point ab,
R2Vector aUv) |
Given a line segment AB whose origin A has been projected onto a given cube face, determine
whether it is necessary to project A onto a different face instead.
|
static R2Vector |
R2Vector.mul(R2Vector p,
double m) |
Returns the element-wise multiplication of p1 and p2, e.g.
|
static R2Vector |
R2Vector.normalize(R2Vector vector) |
Returns a new vector scaled to magnitude 1, or a copy of the original vector if magnitude was
0.
|
static int |
S2.planarCCW(R2Vector a,
R2Vector b) |
Returns +1 if the edge AB is CCW around the origin, -1 if its clockwise, and 0 if the result is
indeterminate.
|
static int |
S2.planarOrderedCCW(R2Vector a,
R2Vector b,
R2Vector c) |
|
(package private) void |
R2Vector.set(R2Vector v) |
Sets the position of this vector from the given other vector.
|
private void |
S2EdgeQuery.splitUBound(R2Rect edgeBound,
double u,
R2Rect[] childBounds,
R2Vector aVector,
R2Vector bVector) |
Splits the current edge into two child edges at u and returns the bound for each child.
|
private void |
S2EdgeQuery.splitVBound(R2Rect edgeBound,
double v,
R2Rect[] childBounds,
R2Vector aVector,
R2Vector bVector) |
Splits the current edge into two child edges at v and returns the bound for each child.
|
static R2Vector |
R2Vector.sub(R2Vector p1,
R2Vector p2) |
Returns the vector result of p1 - p2 .
|
(package private) static void |
S2Projections.validFaceXyzToUv(int face,
S2Point p,
R2Vector result) |
|