Interval.js 565 B

12345678910111213141516171819202122232425
  1. import defaultValue from "./defaultValue.js";
  2. /**
  3. * Represents the closed interval [start, stop].
  4. * @alias Interval
  5. * @constructor
  6. *
  7. * @param {Number} [start=0.0] The beginning of the interval.
  8. * @param {Number} [stop=0.0] The end of the interval.
  9. */
  10. function Interval(start, stop) {
  11. /**
  12. * The beginning of the interval.
  13. * @type {Number}
  14. * @default 0.0
  15. */
  16. this.start = defaultValue(start, 0.0);
  17. /**
  18. * The end of the interval.
  19. * @type {Number}
  20. * @default 0.0
  21. */
  22. this.stop = defaultValue(stop, 0.0);
  23. }
  24. export default Interval;