chunk-AJFR3FGC.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. import {
  2. a
  3. } from "./chunk-RYY6632W.js";
  4. // node_modules/@arcgis/core/core/Cyclical.js
  5. var i = class {
  6. constructor(n, i2) {
  7. this.min = n, this.max = i2, this.range = i2 - n;
  8. }
  9. ndiff(n, i2 = 0) {
  10. return Math.ceil((n - i2) / this.range) * this.range + i2;
  11. }
  12. _normalize(n, i2, t2, o2 = 0, r2 = false) {
  13. return (t2 -= o2) < n ? t2 += this.ndiff(n - t2) : t2 > i2 && (t2 -= this.ndiff(t2 - i2)), r2 && t2 === i2 && (t2 = n), t2 + o2;
  14. }
  15. normalize(n, i2 = 0, t2 = false) {
  16. return this._normalize(this.min, this.max, n, i2, t2);
  17. }
  18. clamp(i2, t2 = 0) {
  19. return a(i2 - t2, this.min, this.max) + t2;
  20. }
  21. monotonic(n, i2, t2) {
  22. return n < i2 ? i2 : i2 + this.ndiff(n - i2, t2);
  23. }
  24. minimalMonotonic(n, i2, t2) {
  25. return this._normalize(n, n + this.range, i2, t2);
  26. }
  27. center(n, i2, t2) {
  28. return i2 = this.monotonic(n, i2, t2), this.normalize((n + i2) / 2, t2);
  29. }
  30. diff(n, i2, t2) {
  31. return this.monotonic(n, i2, t2) - n;
  32. }
  33. shortestSignedDiff(n, i2) {
  34. n = this.normalize(n);
  35. const t2 = (i2 = this.normalize(i2)) - n, o2 = i2 < n ? this.minimalMonotonic(n, i2) - n : i2 - this.minimalMonotonic(i2, n);
  36. return Math.abs(t2) < Math.abs(o2) ? t2 : o2;
  37. }
  38. contains(n, i2, t2) {
  39. return i2 = this.minimalMonotonic(n, i2), (t2 = this.minimalMonotonic(n, t2)) > n && t2 < i2;
  40. }
  41. };
  42. function t(n) {
  43. for (const i2 in n) {
  44. const t2 = n[i2];
  45. t2 instanceof Function && (n[i2] = t2.bind(n));
  46. }
  47. return n;
  48. }
  49. var o = t(new i(0, 2 * Math.PI));
  50. var r = t(new i(-Math.PI, Math.PI));
  51. var s = t(new i(0, 360));
  52. export {
  53. s
  54. };
  55. //# sourceMappingURL=chunk-AJFR3FGC.js.map