Uses of Class
com.google.common.geometry.R2Vector

  • Uses of R2Vector in com.google.common.geometry

    Fields in com.google.common.geometry declared as R2Vector
    Modifier and Type
    Field
    Description
    (package private) final R2Vector
    S2EdgeUtil.FaceSegment.a
     
    (package private) final R2Vector
    S2EdgeUtil.FaceSegment.b
     
    private final R2Vector
    S2ShapeIndexRegion.p0
    Temporary R2 point for internal usage.
    private final R2Vector
    S2ShapeIndexRegion.p1
    Temporary R2 point for internal usage.
    Methods in com.google.common.geometry that return R2Vector
    Modifier and Type
    Method
    Description
    static R2Vector
    R2Vector.add(R2Vector p1, R2Vector p2)
    Returns the vector result of p1 - p2.
    R2Rect.clampPoint(R2Vector p)
    Return the closest point in this rectangle to the given point "p".
    static R2Vector
    S2Projections.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.
    R2Rect.getCenter()
    Returns the center of this rectangle in (x,y)-space.
    S2CellId.getCenterST()
    Returns the center of the cell in (s,t) coordinates.
    S2Cell.getCenterUV()
    Return the center of the cell in (u,v) coordinates (see S2Projections).
    S2CellId.getCenterUV()
    Returns the center of the cell in (u,v) coordinates.
    R2Rect.getSize()
    Return the width and height of this rectangle in (x,y)-space.
    R2Rect.getVertex(int k)
    Returns the kth vertex of this rectangle (k = 0,1,2,3) in CCW order.
    R2Rect.getVertex(int i, int j)
    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).
    R2Rect.hi()
    Returns the point in this rectangle with the maximum x and y values.
    R2Rect.lo()
    Returns the point in this rectangle with the minimum x and y values.
    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.
    R2Vector.ortho()
    Returns a new R2 vector orthogonal to the current one with the same norm and counterclockwise to it.
    static R2Vector
    R2Vector.sub(R2Vector p1, R2Vector p2)
    Returns the vector result of p1 - p2.
    static R2Vector
    S2Projections.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]).
    Methods in com.google.common.geometry with parameters of type R2Vector
    Modifier and Type
    Method
    Description
    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.
    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.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
    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, 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, 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
    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
    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
    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)
    As S2Projections.validFaceXyzToUv(int, S2Point), except result is updated, instead of a being returned in a new instance.
    Method parameters in com.google.common.geometry with type arguments of type R2Vector
    Modifier and Type
    Method
    Description
    private void
    S2FractalBuilder.getR2Vertices(List<R2Vector> vertices)
     
    private void
    S2FractalBuilder.getR2VerticesHelper(R2Vector v0, R2Vector v4, int level, 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".
    Constructors in com.google.common.geometry with parameters of type R2Vector
    Modifier
    Constructor
    Description
    private
    FaceEdge(int shapeId, int edgeId, S2Point va, S2Point vb, R2Vector a, R2Vector b, double cellSizeToLongEdgeRatio)
     
     
    Constructs a rectangle from the given lower-left and upper-right points.