function pickEllipsoid3D(camera, windowPosition, ellipsoid, result) {
  ellipsoid = ellipsoid ?? Ellipsoid.default;
  const ray = camera.getPickRay(windowPosition, pickEllipsoid3DRay);
  const intersection = IntersectionTests.rayEllipsoid(ray, ellipsoid);
  if (!intersection) {
    return undefined;
  }

  const t = intersection.start > 0.0 ? intersection.start : intersection.stop;
  return Ray.getPoint(ray, t, result);
}
Get the camera position needed to view a rectangle on an ellipsoid or map

@param {Rectangle} rectangle The rectangle to view.
@param {Cartesian3} [result] The camera position needed to view the rectangle
@returns {Cartesian3} The camera position needed to view the rectangle