(points, options = {})
| 101563 | var _polygonUtils = require("./polygon-utils"); |
| 101564 | class Polygon { |
| 101565 | constructor(points, options = {}){ |
| 101566 | (0, _definePropertyDefault.default)(this, "points", void 0); |
| 101567 | (0, _definePropertyDefault.default)(this, "isFlatArray", void 0); |
| 101568 | (0, _definePropertyDefault.default)(this, "options", void 0); |
| 101569 | this.points = points; |
| 101570 | this.isFlatArray = !(0, _core.isArray)(points[0]); |
| 101571 | this.options = { |
| 101572 | start: options.start || 0, |
| 101573 | end: options.end || points.length, |
| 101574 | size: options.size || 2, |
| 101575 | isClosed: options.isClosed |
| 101576 | }; |
| 101577 | Object.freeze(this); |
| 101578 | } |
| 101579 | getSignedArea() { |
| 101580 | if (this.isFlatArray) return (0, _polygonUtils.getPolygonSignedArea)(this.points, this.options); |
| 101581 | return (0, _polygonUtils.getPolygonSignedAreaPoints)(this.points, this.options); |
nothing calls this directly
no outgoing calls
no test coverage detected