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]));
158 DLLEXPORT Vec2
Rotate(
const Vec2& v,
Real ang);
Real DLLEXPORT_OST_GEOM Angle(const Line2 &l1, const Line2 &l2)
Real DLLEXPORT_OST_GEOM SignedAngle(const Vec2 &v1, const Vec2 &v2)
angle beetwen two vectors (honors sign)
Quat DLLEXPORT_OST_GEOM Normalize(const Quat &q)
Mat2 DLLEXPORT_OST_GEOM Invert(const Mat2 &m)
Matrix inversion.
Vec2 operator*(const Vec2 &v, const Mat2 &m)
vector matrix multiplication
Real DLLEXPORT_OST_GEOM Dot(const Quat &q0, const Quat &q1)
Real Length2(const Vec2 &v)
returns squared length of vector
bool DLLEXPORT_OST_GEOM Equal(const Line2 &l1, const Line2 &l2, Real ephilon=EPSILON)
Real Length(const Vec2 &v)
returns length of vector
Vec2 CompDivide(const Vec2 &v1, const Vec2 &v2)
divide each component of v1 by that of v2
static const Real EPSILON
Vec2 Max(const Vec2 &v1, const Vec2 &v2)
Real DLLEXPORT_OST_GEOM Det(const Mat2 &m)
determinant
Vec2 CompMultiply(const Vec2 &v1, const Vec2 &v2)
multiply each component of v1 with that of v2
Mat2 DLLEXPORT_OST_GEOM Transpose(const Mat2 &m)
Transpose.
Vec2 Min(const Vec2 &v1, const Vec2 &v2)
#define DLLEXPORT_OST_GEOM
DLLEXPORT Vec2 Rotate(const Vec2 &v, Real ang)
Rotation.