|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgeomerative.RMatrix
public class RMatrix
RMatrix is a very simple interface for creating, holding 3x3 matrices with the most common 2D affine transformations such as translation, rotation, scaling and shearing. We only have access to the first to rows of the matrix the last row is considered a constant 0, 0, 1 in order to have better performance.
Constructor Summary | |
---|---|
RMatrix()
Create a new identity matrix. |
|
RMatrix(float m00,
float m01,
float m02,
float m10,
float m11,
float m12)
Create a new matrix given the coefficients. |
|
RMatrix(RMatrix src)
Copy a matrix. |
|
RMatrix(java.lang.String transformationString)
|
Method Summary | |
---|---|
void |
apply(float n00,
float n01,
float n02,
float n10,
float n11,
float n12)
Multiply the matrix with another matrix. |
void |
apply(RMatrix rhs)
Multiply the matrix with another matrix. |
void |
rotate(float angle)
|
void |
rotate(float angle,
float vx,
float vy)
Apply a rotation to the matrix, given an angle and optionally a rotation center. |
void |
rotate(float angle,
RPoint v)
Apply a rotation to the matrix, given an angle and optionally a rotation center. |
void |
scale(float s)
|
void |
scale(float sx,
float sy)
|
void |
scale(float s,
float x,
float y)
Apply a scale to the matrix, given scaling factors and optionally a scaling center. |
void |
scale(float sx,
float sy,
float x,
float y)
Apply a scale to the matrix, given scaling factors and optionally a scaling center. |
void |
scale(float sx,
float sy,
RPoint p)
Apply a scale to the matrix, given scaling factors and optionally a scaling center. |
void |
scale(float s,
RPoint p)
Apply a scale to the matrix, given scaling factors and optionally a scaling center. |
void |
shear(float shx,
float shy)
Use this to apply a shearing to the matrix. |
void |
skewX(float angle)
Use this to apply a skewing to the matrix. |
void |
skewY(float angle)
|
void |
translate(float tx)
|
void |
translate(float tx,
float ty)
Apply a translation to the matrix, given the coordinates. |
void |
translate(RPoint t)
Apply a translation to the matrix, given a point. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RMatrix(float m00, float m01, float m02, float m10, float m11, float m12)
m00
- coefficient 00 of the matrixm01
- coefficient 01 of the matrixm02
- coefficient 02 of the matrixm10
- coefficient 10 of the matrixm11
- coefficient 11 of the matrixm12
- coefficient 12 of the matrixpublic RMatrix()
public RMatrix(RMatrix src)
src
- source matrix from where to copy the matrixpublic RMatrix(java.lang.String transformationString)
Method Detail |
---|
public void apply(float n00, float n01, float n02, float n10, float n11, float n12)
n00
- coefficient 00 of the matrix to be appliedn01
- coefficient 01 of the matrix to be appliedn02
- coefficient 02 of the matrix to be appliedn10
- coefficient 10 of the matrix to be appliedn11
- coefficient 11 of the matrix to be appliedn12
- coefficient 12 of the matrix to be appliedpublic void apply(RMatrix rhs)
rhs
- right hand side matrixpublic void translate(float tx, float ty)
tx
- x coordinate translationty
- y coordinate translationpublic void translate(float tx)
public void translate(RPoint t)
t
- vector translationpublic void rotate(float angle, float vx, float vy)
angle
- the angle of rotation to be appliedvx
- the x coordinate of the center of rotationvy
- the y coordinate of the center of rotationpublic void rotate(float angle)
public void rotate(float angle, RPoint v)
angle
- the angle of rotation to be appliedv
- the position vector of the center of rotationpublic void scale(float sx, float sy, float x, float y)
sx
- the scaling coefficient over the x axissy
- the scaling coefficient over the y axisx
- x coordinate of the position vector of the center of the scalingy
- y coordinate of the position vector of the center of the scalingpublic void scale(float sx, float sy)
public void scale(float s, float x, float y)
s
- the scaling coefficient for a uniform scalingx
- x coordinate of the position vector of the center of the scalingy
- y coordinate of the position vector of the center of the scalingpublic void scale(float sx, float sy, RPoint p)
sx
- the scaling coefficient over the x axissy
- the scaling coefficient over the y axisp
- the position vector of the center of the scalingpublic void scale(float s, RPoint p)
s
- the scaling coefficient for a uniform scalingp
- the position vector of the center of the scalingpublic void scale(float s)
public void skewX(float angle)
angle
- skewing anglepublic void skewY(float angle)
public void shear(float shx, float shy)
shx
- x coordinate shearingshy
- y coordinate shearing
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |