31 void B2DHomMatrix::set3x2(
double f_0x0,
double f_0x1,
double f_0x2,
double f_1x0,
double f_1x1,
double f_1x2)
48 const double fValueAB(
get(
a,
b));
50 if(!::basegfx::fTools::equal(fDefault, fValueAB))
111 dst[0] = +
get(1, 1);
112 dst[1] = -
get(0, 1);
113 dst[2] = +
get(0, 1) *
get(1, 2) -
get(0, 2) *
get(1, 1);
114 dst[3] = -
get(1, 0);
115 dst[4] = +
get(0, 0);
116 dst[5] = -
get(0, 0) *
get(1, 2) +
get(0, 2) *
get(1, 0);
150 for(sal_uInt16
a(0);
a < 2; ++
a)
152 for(sal_uInt16
b(0);
b < 3; ++
b)
156 for(sal_uInt16
c(0);
c < 2; ++
c)
169 for(sal_uInt16
a(0);
a < 2;
a++)
171 for(sal_uInt16
b(0);
b < 3;
b++)
176 if(!::basegfx::fTools::equal(fValueA, fValueB))
187 return !(*
this == rMat);
201 aRotMat.
set(0, 0, fCos);
202 aRotMat.
set(1, 1, fCos);
203 aRotMat.
set(1, 0, fSin);
204 aRotMat.
set(0, 1, -fSin);
215 aTransMat.
set(0, 2, fX);
216 aTransMat.
set(1, 2, fY);
229 const double fOne(1.0);
235 aScaleMat.
set(0, 0, fX);
236 aScaleMat.
set(1, 1, fY);
254 aShearXMat.
set(0, 1, fSx);
267 aShearYMat.
set(1, 0, fSy);
283 rRotate = rShearX = 0.0;
295 if( rScale.
getX() < 0 && rScale.
getY() < 0 )
307 const double fScalarXY(aUnitVecX.
scalar(aUnitVecY));
322 if(bXIsZero || bYIsZero)
328 rRotate = atan2(aUnitVecX.
getY(), aUnitVecX.
getX());
334 rRotate = atan2(aUnitVecY.
getY(), aUnitVecY.
getX()) - M_PI_2;
345 rRotate = atan2(aUnitVecX.
getY(), aUnitVecX.
getX());
348 const double fCrossXY(aUnitVecX.
cross(aUnitVecY));
360 double fCrossXY(aUnitVecX.
cross(aUnitVecY));
365 rRotate = atan2(aUnitVecX.
getY(), aUnitVecX.
getX());
387 rShearX = fScalarXY / fCrossXY;
397 const double fNegRotate(-rRotate);
398 const double fSin(sin(fNegRotate));
399 const double fCos(cos(fNegRotate));
401 const double fNewX(aUnitVecY.
getX() * fCos - aUnitVecY.
getY() * fSin);
402 const double fNewY(aUnitVecY.
getX() * fSin + aUnitVecY.
getY() * fCos);
404 aUnitVecY.
setX(fNewX);
405 aUnitVecY.
setY(fNewY);
410 aUnitVecY.
setX(aUnitVecY.
getX() - (aUnitVecY.
getY() * rShearX));
411 fCrossXY = aUnitVecX.
cross(aUnitVecY);
bool operator!=(const B2DHomMatrix &rMat) const
bool decompose(B2DTuple &rScale, B2DTuple &rTranslate, double &rRotate, double &rShearX) const
Help routine to decompose given homogen 3x3 matrix to components.
void computeAdjoint(double(&dst)[6]) const
bool isInvertible() const
void set3x2(double f_0x0, double f_0x1, double f_0x2, double f_1x0, double f_1x1, double f_1x2)
allow setting all needed values for a 3x2 matrix in one call.
bool operator==(const B2DHomMatrix &rMat) const
double computeDeterminant(double(&dst)[6]) const
void set(sal_uInt16 nRow, sal_uInt16 nColumn, double fValue)
void rotate(double fRadiant)
B2DHomMatrix & operator*=(const B2DHomMatrix &rMat)
void translate(double fX, double fY)
std::array< std::array< double, 3 >, 2 > mfValues
double get(sal_uInt16 nRow, sal_uInt16 nColumn) const
void scale(double fX, double fY)
void doMulMatrix(const B2DHomMatrix &rMat)
Base class for all Points/Vectors with two double values.
Base Point class with two double values.
double scalar(const B2DVector &rVec) const
Calculate the Scalar with another 2D Vector.
double cross(const B2DVector &rVec) const
Calculate the length of the cross product with another 2D Vector.
double getLength() const
Calculate the length of this 2D Vector.
TYPE getX() const
Get X-Coordinate of 2D Tuple.
void setY(TYPE fY)
Set Y-Coordinate of 2D Tuple.
TYPE getY() const
Get Y-Coordinate of 2D Tuple.
void setX(TYPE fX)
Set X-Coordinate of 2D Tuple.
constexpr double implGetDefaultValue(sal_uInt16 nRow, sal_uInt16 nColumn)
void createSinCosOrthogonal(double &o_rSin, double &o_rCos, double fRadiant)
If the rotation angle is an approximate multiple of pi/2, force fSin/fCos to -1/0/1,...