/* Load vectors */
a: [1, 2];
b: [5, 6];
c: [1.5, 2.5];

/* Functions for lerp and slerp */
lerp(a, b, t) := (1-t)*a+t*b;
slerp(a, b, t) := (sin((1-t)*acos(a.b))/sin(acos(a.b)))*a+(sin(t*acos(a.b))/sin(acos(a.b)))*b;

/* Operations */
_add: a + b;
_sub: a - b;
_mul: a * b;
_scale: a * 10;
_madd: a * b + c;
_negate: -a;
_dot: a . b;
_cross: determinant(matrix([i, j, k], [a[1], a[2], 0], [b[1], b[2], 0]));
_length: sqrt(a.a);
_normal: a / sqrt(a.a);
_lerpa: lerp(a, b, 0);
_lerph: lerp(a, b, 0.5);
_lerpb: lerp(a, b, 1);
_slerpa: float(slerp(a, b, 0));
_slerph: float(slerp(a, b, 0.5));
_slerpb: float(slerp(a, b, 1));

_bary1: a+0.5*(b-a)+0.5*(c-a);
_bary2: a+0.25*(b-a)+0.5*(c-a);

a:[1,2];
b:[4,3];
c:[4,4];
_bary3: a+0.5*(b-a)+0.5*(c-a);
_bary4: a+0.25*(b-a)+0.5*(c-a);

_project: float(b*((a.b)/(b.b)));