Returns the vector result of p1 - p2
.
Return the closest point in this rectangle to the given point "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.
Returns the center of this rectangle in (x,y)-space.
Returns the center of the cell in (s,t) coordinates.
Return the center of the cell in (u,v) coordinates (see S2Projections
).
Returns the center of the cell in (u,v) coordinates.
Return the width and height of this rectangle in (x,y)-space.
Returns the kth vertex of this rectangle (k = 0,1,2,3) in CCW order.
Returns the vertex in direction "i" along the x-axis (0=left, 1=right) and direction "j" along
the y-axis (0=down, 1=up).
Returns the point in this rectangle with the maximum x and y values.
Returns the point in this rectangle with the minimum x and y values.
Returns the element-wise multiplication of p1 and p2, e.g.
Returns a new vector scaled to magnitude 1, or a copy of the original vector if magnitude was
0.
Returns a new R2 vector orthogonal to the current one with the same norm and counterclockwise
to it.
Returns the vector result of p1 - p2
.
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]).
Returns the vector result of p1 - p2
.
void
Increase the size of the bounding rectangle to include the given point.
Return the closest point in this rectangle to the given point "p".
(package private) static int
This helper function does two things.
(package private) static boolean
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
This function can be used to clip an edge AB to sequence of rectangles efficiently.
static boolean
Given an edge AB and a face, return the (u,v) coordinates for the portion of AB that intersects
that face.
static boolean
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
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
Returns true if this rectangle contains the given point.
double
Returns the cross product of this vector with that vector.
double
Returns the dot product of this vector with that vector.
static double
Returns the dot product of the given vectors.
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().
Convert (face, u, v) coordinates to a direction vector (not necessarily unit length).
Returns a new rectangle from a center point and size in each dimension.
Returns a rectangle containing a single point.
Returns the minimal bounding rectangle containing the two given points.
private void
Computes the index cells intersected by the current edge that are descendants of pCell
,
and adds them to cells
.
(package private) boolean
Adds all cells to cells
that might intersect the query edge from a
to b
and the cell root
.
(package private) static R2Rect
Given an edge AB and a rectangle "clip", return the bounding rectangle of the portion of AB
intersected by "clip".
(package private) static void
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
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
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
Returns true if and only if the given point is contained in the interior of the region (i.e.
(package private) static boolean
Returns true if the edge AB intersects the given (closed) rectangle to within the error bound
below.
boolean
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
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.
Returns the element-wise multiplication of p1 and p2, e.g.
Returns a new vector scaled to magnitude 1, or a copy of the original vector if magnitude was
0.
static int
Returns +1 if the edge AB is CCW around the origin, -1 if its clockwise, and 0 if the result is
indeterminate.
static int
(package private) void
Sets the position of this vector from the given other vector.
private void
Splits the current edge into two child edges at u
and returns the bound for each child.
private void
Splits the current edge into two child edges at v
and returns the bound for each child.
Returns the vector result of p1 - p2
.
(package private) static void