modeling/src/geometries/poly2/measureArea.js

  1. /**
  2. * Measure the area under the given polygon.
  3. *
  4. * @param {poly2} polygon - the polygon to measure
  5. * @return {Number} the area of the polygon
  6. * @alias module:modeling/geometries/poly2.measureArea
  7. */
  8. const area = require('../../maths/utils/area')
  9. const measureArea = (polygon) => area(polygon.vertices)
  10. module.exports = measureArea