/**
 * Math classes and utilities mixed into V namespace.
 *
 * @lends V
 */
export { default as Point } from './Point';
export { default as Vector } from './Point';
export { default as ObservablePoint } from './ObservablePoint';
export { default as Matrix } from './Matrix';
export { default as GroupD8 } from './GroupD8';
export { default as Bounds } from './Bounds';

export { default as TransformBase } from './TransformBase';
export { default as Transform } from './Transform';
export { default as TransformStatic } from './TransformStatic';

export { default as Circle } from './shapes/Circle';
export { default as Ellipse } from './shapes/Ellipse';
export { default as Polygon } from './shapes/Polygon';
export { default as Rectangle } from './shapes/Rectangle';
export { default as RoundedRectangle } from './shapes/RoundedRectangle';

/**
 * Force a value within the boundaries by clamping `x` to the range `[a, b]`.
 *
 * @param {number} x Target value to clamp
 * @param {number} a Min value
 * @param {number} b Max value
 * @return {number} Clamped value
 */
export function clamp(x, a, b) {
  return (x < a) ? a : ((x > b) ? b : x);
}

/**
 * Bring the value between min and max.
 *
 * Values larger than `max` are wrapped back to `min`
 * and vice-versa.
 *
 * @param {number}  value value to process
 * @param {number}  min lowest valid value
 * @param {number}  max largest valid value
 * @return {number} result
 */
export function wrap(value, min, max) {
  if (value < min) {return max + (value % max);}
  if (value >= max) {return value % max;}
  return value;
}

export function ease(p_x, p_c) {
    if (p_x < 0) {
        p_x = 0;
    }
    else if (p_x > 1) {
        p_x = 1;
    }
    if (p_c > 0) {
        if (p_c < 1) {
            return 1 - Math.pow(1 - p_x, 1.0 / p_c);
        }
        else {
            return Math.pow(p_x, p_c);
        }
    }
    else if (p_c < 0) {
        //inout ease

        if (p_x < 0.5) {
            return Math.pow(p_x * 2, -p_c) * 0.5;
        } else {
            return (1 - Math.pow(1 - (p_x - 0.5) * 2, -p_c)) * 0.5 + 0.5;
        }
    }
    else {
        return 0; // no ease (raw)
    }
}

const DEG_TO_RAD = Math.PI / 180;
export function deg2rad(deg) {
    return DEG_TO_RAD * deg;
}

const RAD_TO_DEG = 180 / Math.PI;
export function rad2deg(rad) {
    return RAD_TO_DEG * rad;
}

@@ -837,16 +837,76 @@
 ngle';%0A%0A
+export const PI = Math.PI;%0Aexport const PI2 = Math.PI * 2;%0A%0A
 /**%0A * F
@@ -1498,21 +1498,21 @@
 ort 
-function
+const
  wrap
+ = 
 (val
@@ -1529,22 +1529,18 @@
 ax) 
-%7B%0A  if
+=%3E
  (value 
 %3C mi
@@ -1539,104 +1539,341 @@
 lue 
-%3C
+-
  min) 
-%7Breturn max + (value %25 max);%7D%0A  if (value %3E= max) %7Breturn value %25 max;%7D%0A  return value;%0A%7D
+%25 (max - min) + min;%0A%0Aexport const mod = (a, n) =%3E (a %25 n + n) %25 n;%0A%0Aexport const lerp = (a, b, fct) =%3E a + (b - a) * fct;%0A%0A/**%0A * wrap to %5B-PI, +PI%5D%0A */%0Aexport const wrap_angle = (a) =%3E (a + PI) %25 PI2 - PI;%0A%0A/**%0A * Minimal difference between 2 angles%0A */%0Aexport const angle_difference = (a, b) =%3E mod((b - a + PI), PI2) - PI;
 %0A%0Aex

Add more math utility functions