All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.geom.flat.reverse.js Maven / Gradle / Ivy

The newest version!
/**
 * @module ol/geom/flat/reverse
 */

/**
 * @param {Array} flatCoordinates Flat coordinates.
 * @param {number} offset Offset.
 * @param {number} end End.
 * @param {number} stride Stride.
 */
export function coordinates(flatCoordinates, offset, end, stride) {
  while (offset < end - stride) {
    for (let i = 0; i < stride; ++i) {
      const tmp = flatCoordinates[offset + i];
      flatCoordinates[offset + i] = flatCoordinates[end - stride + i];
      flatCoordinates[end - stride + i] = tmp;
    }
    offset += stride;
    end -= stride;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy