function EllipsoidTangentPlane(origin, ellipsoid) {
  //>>includeStart('debug', pragmas.debug);
  Check.defined("origin", origin);
  //>>includeEnd('debug');

  ellipsoid = ellipsoid ?? Ellipsoid.default;
  origin = ellipsoid.scaleToGeodeticSurface(origin);

  //>>includeStart('debug', pragmas.debug);
  if (!defined(origin)) {
    throw new DeveloperError(
      "origin must not be at the center of the ellipsoid.",
    );
  }
  //>>includeEnd('debug');

  const eastNorthUp = Transforms.eastNorthUpToFixedFrame(origin, ellipsoid);
  this._ellipsoid = ellipsoid;
  this._origin = origin;
  this._xAxis = Cartesian3.fromCartesian4(
    Matrix4.getColumn(eastNorthUp, 0, scratchCart4),
  );
  this._yAxis = Cartesian3.fromCartesian4(
    Matrix4.getColumn(eastNorthUp, 1, scratchCart4),
  );

  const normal = Cartesian3.fromCartesian4(
    Matrix4.getColumn(eastNorthUp, 2, scratchCart4),
  );
  this._plane = Plane.fromPointNormal(origin, normal);
}
A plane tangent to the provided ellipsoid at the provided origin.
If origin is not on the surface of the ellipsoid, it's surface projection will be used.
If origin is at the center of the ellipsoid, an exception will be thrown.
@alias EllipsoidTangentPlane
@constructor

@param {Cartesian3} origin The point on the surface of the ellipsoid where the tangent plane touches.
@param {Ellipsoid} [ellipsoid=Ellipsoid.default] The ellipsoid to use.

@exception {DeveloperError} origin must not be at the center of the ellipsoid.