s2js
    Preparing search index...

    Class RectBeta

    Represents a closed latitude-longitude rectangle.

    incomplete

    Implements

    Index

    Constructors

    Other

    validRectLatRange: r1.Interval = ...
    validRectLngRange: s1.Interval = ...
    • Beta

      Reports whether the latitude and longitude intervals of the two rectangles are the same up to a small tolerance.

      Parameters

      Returns boolean

    • Beta

      Centroid returns the true centroid of the given Rect multiplied by its surface area. The result is not unit length, so you may want to normalize it. Note that in general the centroid is not at the center of the rectangle, and in fact it may not even be contained by the rectangle. (It is the "center of mass" of the rectangle viewed as subset of the unit sphere, i.e. it is the point in space about which this curved shape would rotate.)

      The reason for multiplying the result by the rectangle area is to make it easier to compute the centroid of more complicated shapes. The centroid of a union of disjoint regions can be computed simply by adding their Centroid results.

      Returns s2.Point

    • Beta

      Returns a rectangle that has been expanded by margin.lat on each side in the latitude direction, and by margin.lng on each side in the longitude direction.

      Parameters

      Returns s2.Rect

    • Beta

      Returns the rectangle unmodified if it does not include either pole. If it includes either pole, returns an expansion of the rectangle along the longitudinal range.

      Returns s2.Rect