Cleaned up the calculation of bounds of symbols, this fixes bounds calculation with symmetries.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1178 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2008-08-27 23:46:31 +00:00
parent 4b2a36bba8
commit ce906e83f8
11 changed files with 192 additions and 135 deletions
+9 -1
View File
@@ -96,6 +96,10 @@ class Vector2D {
inline Vector2D normalized() const {
return *this / length();
}
/// Angle between this vector and the x axis
inline double angle() const {
return atan2(y,x);
}
inline operator wxPoint() const {
return wxPoint(to_int(x), to_int(y));
@@ -142,7 +146,7 @@ class Matrix2D {
public:
Vector2D mx, my;
inline Matrix2D() {}
inline Matrix2D() : mx(1,0), my(0,1) {}
inline Matrix2D(const Vector2D& mx, const Vector2D& my) : mx(mx), my(my) {}
inline Matrix2D(double a, double b, double c, double d) : mx(a,b), my(c,d) {}
};
@@ -151,6 +155,10 @@ class Matrix2D {
inline Vector2D operator * (const Vector2D& a, const Matrix2D& m) {
return Vector2D(dot(a,m.mx), dot(a,m.my));
}
/// vector-matrix product
inline Matrix2D operator * (const Matrix2D& a, const Matrix2D& m) {
return Matrix2D(a.mx * m, a.my * m);
}
// ----------------------------------------------------------------------------- : EOF