function getTangentPlane(rectangle, positions, ellipsoid) {
  if (rectangle.height >= CesiumMath.PI || rectangle.width >= CesiumMath.PI) {
    const polar = Stereographic.fromCartesian(
      positions[0],
      scratchPolarForPlane,
    );
    return polar.tangentPlane;
  }

  // Use a local tangent plane for smaller extents
  return EllipsoidTangentPlane.fromPoints(positions, ellipsoid);
}
Computes a rectangle which encloses the polygon defined by the list of positions, including cases over the international date line and the poles.

@param {Cartesian3[]} positions A linear ring defining the outer boundary of the polygon.
@param {Ellipsoid} [ellipsoid=Ellipsoid.default] The ellipsoid to be used as a reference.
@param {ArcType} [arcType=ArcType.GEODESIC] The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
@param {Rectangle} [result] An object in which to store the result.

@returns {Rectangle} The result rectangle