22 #ifndef CHIPMUNK_VECT_H
23 #define CHIPMUNK_VECT_H
25 #include "chipmunk_types.h"
44 return (v1.x == v2.x && v1.y == v2.y);
50 return cpv(v1.x + v2.x, v1.y + v2.y);
56 return cpv(v1.x - v2.x, v1.y - v2.y);
62 return cpv(-v.x, -v.y);
68 return cpv(v.x*s, v.y*s);
74 return v1.x*v2.x + v1.y*v2.y;
82 return v1.x*v2.y - v1.y*v2.x;
88 return cpv(-v.y, v.x);
94 return cpv(v.y, -v.x);
106 return cpv(cpfcos(a), cpfsin(a));
112 return cpfatan2(v.y, v.x);
118 return cpv(v1.x*v2.x - v1.y*v2.y, v1.x*v2.y + v1.y*v2.x);
124 return cpv(v1.x*v2.x + v1.y*v2.y, v1.y*v2.x - v1.x*v2.y);
136 return cpfsqrt(
cpvdot(v, v));
163 cpFloat denom = 1.0f/cpfsin(omega);
225 return cpv(v.x*m.a + v.y*m.b, v.x*m.c + v.y*m.d);