function getPointResolution(projection, resolution, point, units) {
  projection = get(projection);
  let pointResolution;
  const getter = projection.getPointResolutionFunc();
  if (getter) {
    pointResolution = getter(resolution, point);
    if (units && units !== projection.getUnits()) {
      const metersPerUnit = projection.getMetersPerUnit();
      if (metersPerUnit) {
        pointResolution =
          (pointResolution * metersPerUnit) / METERS_PER_UNIT[units];
      }
    }
  } else {
    const projUnits = projection.getUnits();
    if ((projUnits == 'degrees' && !units) || units == 'degrees') {
      pointResolution = resolution;
    } else {
      // Estimate point resolution by transforming the center pixel to EPSG:4326,
      // measuring its width and height on the normal sphere, and taking the
      // average of the width and height.
      const toEPSG4326 = getTransformFromProjections(
        projection,
        get('EPSG:4326'),
      );
      if (!toEPSG4326 && projUnits !== 'degrees') {
        // no transform is available
        pointResolution = resolution * projection.getMetersPerUnit();
      } else {
        let vertices = [
          point[0] - resolution / 2,
          point[1],
          point[0] + resolution / 2,
          point[1],
          point[0],
          point[1] - resolution / 2,
          point[0],
          point[1] + resolution / 2,
        ];
        vertices = toEPSG4326(vertices, vertices, 2);
        const width = getDistance(vertices.slice(0, 2), vertices.slice(2, 4));
        const height = getDistance(vertices.slice(4, 6), vertices.slice(6, 8));
        pointResolution = (width + height) / 2;
      }
      const metersPerUnit = units
        ? METERS_PER_UNIT[units]
        : projection.getMetersPerUnit();
      if (metersPerUnit !== undefined) {
        pointResolution /= metersPerUnit;
      }
    }
  }
  return pointResolution;
}
Get the resolution of the point in degrees or distance units.
For projections with degrees as the unit this will simply return the
provided resolution. For other projections the point resolution is
by default estimated by transforming the `point` pixel to EPSG:4326,
measuring its width and height on the normal sphere,
and taking the average of the width and height.
A custom function can be provided for a specific projection, either
by setting the `getPointResolution` option in the
{@link module:ol/proj/Projection~Projection} constructor or by using
{@link module:ol/proj/Projection~Projection#setGetPointResolution} to change an existing
projection object.
@param {ProjectionLike} projection The projection.
@param {number} resolution Nominal resolution in projection units.
@param {import("./coordinate.js").Coordinate} point Point to find adjusted resolution at.
@param {import("./proj/Units.js").Units} [units] Units to get the point resolution in.
Default is the projection's units.
@return {number} Point resolution.
@api