19 #ifndef GEOM_VECMAT2_OP_HH
20 #define GEOM_VECMAT2_OP_HH
37 return v[0]*v[0]+v[1]*v[1];
49 return std::fabs(v1[0]-v2[0])<ephilon &&
50 std::fabs(v1[1]-v2[1])<ephilon;
56 return std::fabs(m1(0,0)-m2(0,0))<ephilon &&
57 std::fabs(m1(0,1)-m2(0,1))<ephilon &&
58 std::fabs(m1(1,0)-m2(1,0))<ephilon &&
59 std::fabs(m1(1,1)-m2(1,1))<ephilon;
65 return v1[0]*v2[0]+v1[1]*v2[1];
81 Vec2 nrvo(v1[0]*v2[0],v1[1]*v2[1]);
88 Vec2 nrvo(v1[0]/v2[0],v1[1]/v2[1]);
101 Vec2 nrvo(v[0]*m(0,0)+v[1]*m(1,0),
102 v[0]*m(0,1)+v[1]*m(1,1));
115 Vec2 nrvo(v[0]*m(0,0)+v[1]*m(0,1),
116 v[0]*m(1,0)+v[1]*m(1,1));
136 Mat2 nrvo(m1(0,0)*m2(0,0)+m1(0,1)*m2(1,0),
137 m1(0,0)*m2(0,1)+m1(0,1)*m2(1,1),
138 m1(1,0)*m2(0,0)+m1(1,1)*m2(1,0),
139 m1(1,0)*m2(0,1)+m1(1,1)*m2(1,1));
145 Vec2 nrvo(std::min(v1[0],v2[0]),
146 std::min(v1[1],v2[1]));
152 Vec2 nrvo(std::max(v1[0],v2[0]),
153 std::max(v1[1],v2[1]));
#define DLLEXPORT_OST_GEOM
Vec2 CompDivide(const Vec2 &v1, const Vec2 &v2)
divide each component of v1 by that of v2
Real DLLEXPORT_OST_GEOM Angle(const Line2 &l1, const Line2 &l2)
Vec2 Min(const Vec2 &v1, const Vec2 &v2)
Vec2 CompMultiply(const Vec2 &v1, const Vec2 &v2)
multiply each component of v1 with that of v2
Vec2 Max(const Vec2 &v1, const Vec2 &v2)
Quat DLLEXPORT_OST_GEOM Normalize(const Quat &q)
Real DLLEXPORT_OST_GEOM Dot(const Quat &q0, const Quat &q1)
Real DLLEXPORT_OST_GEOM SignedAngle(const Vec2 &v1, const Vec2 &v2)
angle beetwen two vectors (honors sign)
DLLEXPORT Vec2 Rotate(const Vec2 &v, Real ang)
Rotation.
Real Length(const Vec2 &v)
returns length of vector
Real Length2(const Vec2 &v)
returns squared length of vector
static const Real EPSILON
bool DLLEXPORT_OST_GEOM Equal(const Line2 &l1, const Line2 &l2, Real ephilon=EPSILON)
Vec2 operator*(const Vec2 &v, const Mat2 &m)
vector matrix multiplication
Mat2 DLLEXPORT_OST_GEOM Transpose(const Mat2 &m)
Transpose.
Mat2 DLLEXPORT_OST_GEOM Invert(const Mat2 &m)
Matrix inversion.
Real DLLEXPORT_OST_GEOM Det(const Mat2 &m)
determinant