65 mpImpl->set(nRow, nColumn, fValue);
68 void B2DHomMatrix::set3x2(
double f_0x0,
double f_0x1,
double f_0x2,
double f_1x0,
double f_1x1,
double f_1x2)
80 return mpImpl->isLastLineDefault();
95 return mpImpl->isInvertible();
109 if(aWork.
ludcmp(pIndex, nParity))
111 mpImpl->doInvert(aWork, pIndex);
132 const double fOne(1.0);
135 mpImpl->doMulMatrix(fValue);
142 const double fOne(1.0);
145 mpImpl->doMulMatrix(1.0 / fValue);
180 return !(*
this == rMat);
194 aRotMat.
set(0, 0, fCos);
195 aRotMat.
set(1, 1, fCos);
196 aRotMat.
set(1, 0, fSin);
197 aRotMat.
set(0, 1, -fSin);
199 mpImpl->doMulMatrix(aRotMat);
208 aTransMat.
set(0, 2, fX);
209 aTransMat.
set(1, 2, fY);
211 mpImpl->doMulMatrix(aTransMat);
222 const double fOne(1.0);
228 aScaleMat.
set(0, 0, fX);
229 aScaleMat.
set(1, 1, fY);
231 mpImpl->doMulMatrix(aScaleMat);
247 aShearXMat.
set(0, 1, fSx);
249 mpImpl->doMulMatrix(aShearXMat);
260 aShearYMat.
set(1, 0, fSy);
262 mpImpl->doMulMatrix(aShearYMat);
276 if(!
mpImpl->isLastLineDefault())
282 rRotate = rShearX = 0.0;
294 if( rScale.
getX() < 0 && rScale.
getY() < 0 )
306 const double fScalarXY(aUnitVecX.
scalar(aUnitVecY));
321 if(bXIsZero || bYIsZero)
327 rRotate = atan2(aUnitVecX.
getY(), aUnitVecX.
getX());
333 rRotate = atan2(aUnitVecY.
getY(), aUnitVecY.
getX()) - M_PI_2;
344 rRotate = atan2(aUnitVecX.
getY(), aUnitVecX.
getX());
347 const double fCrossXY(aUnitVecX.
cross(aUnitVecY));
359 double fCrossXY(aUnitVecX.
cross(aUnitVecY));
364 rRotate = atan2(aUnitVecX.
getY(), aUnitVecX.
getX());
386 rShearX = fScalarXY / fCrossXY;
396 const double fNegRotate(-rRotate);
397 const double fSin(sin(fNegRotate));
398 const double fCos(cos(fNegRotate));
400 const double fNewX(aUnitVecY.
getX() * fCos - aUnitVecY.
getY() * fSin);
401 const double fNewY(aUnitVecY.
getX() * fSin + aUnitVecY.
getY() * fCos);
403 aUnitVecY.
setX(fNewX);
404 aUnitVecY.
setY(fNewY);
409 aUnitVecY.
setX(aUnitVecY.
getX() - (aUnitVecY.
getY() * rShearX));
410 fCrossXY = aUnitVecX.
cross(aUnitVecY);
bool isLastLineDefault() const
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.
B2DHomMatrix & operator=(const B2DHomMatrix &rMat)
bool isInvertible() const
B2DHomMatrix & operator/=(double fValue)
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
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)
double get(sal_uInt16 nRow, sal_uInt16 nColumn) const
void scale(double fX, double fY)
B2DHomMatrix & operator*=(double fValue)
B2DHomMatrix & operator-=(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.
static sal_uInt16 getEdgeLength()
void set(sal_uInt16 nRow, sal_uInt16 nColumn, const double &rValue)
bool ludcmp(sal_uInt16 nIndex[], sal_Int16 &nParity)
bool same_object(const cow_wrapper &rOther) const
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,...
static o3tl::cow_wrapper< Impl2DHomMatrix > DEFAULT
::basegfx::internal::ImplHomMatrixTemplate< 3 > Impl2DHomMatrix_Base