Matrix

Overview

Matrix is a class in Aspose.PDF FOSS for Java.

Represents a 3x3 affine transformation matrix used in PDF graphics state.

This class provides 20 methods for working with Matrix objects in Java programs. Available methods include: Matrix, equals, fromPdfArray, getA, getB, getC, getD, getE, getF, getValues, hashCode, multiply, and 6 additional methods. All public members are accessible to any Java application after installing the Aspose.PDF FOSS for Java package. Properties: IDENTITY, a, b, c, d, e, and 2 more.

Properties

NameTypeAccessDescription
valuesdouble[]ReadReturns a copy of the six matrix values.
adoubleReadReturns the a (scale X / rotate) component.
bdoubleReadReturns the b (rotate / skew) component.
cdoubleReadReturns the c (rotate / skew) component.
ddoubleReadReturns the d (scale Y / rotate) component.
edoubleReadReturns the e (translate X) component.
fdoubleReadReturns the f (translate Y) component.
IDENTITYMatrixReadThe identity matrix (no transformation).

Methods

SignatureDescription
Matrix(a: double, b: double, c: double, d: double, e: double, f: double)Creates a matrix with the specified six values.
Matrix(elements: double[])Creates a matrix from a six-element array.
Matrix()Creates the identity matrix.
rotation(angleRadians: double)MatrixCreates a rotation matrix for the given angle in radians.
getValues()double[]Returns a copy of the six matrix values.
getA()doubleReturns the a (scale X / rotate) component.
getB()doubleReturns the b (rotate / skew) component.
getC()doubleReturns the c (rotate / skew) component.
getD()doubleReturns the d (scale Y / rotate) component.
getE()doubleReturns the e (translate X) component.
getF()doubleReturns the f (translate Y) component.
multiply(other: Matrix)MatrixMultiplies this matrix by another, returning a new matrix.
transformPoint(x: double, y: double)double[]Transforms a point (x, y) by this matrix.
reverse()MatrixReturns the inverse matrix.
transform(rectangle: Rectangle)RectangleTransforms a rectangle and returns the axis-aligned bounding box
of the transformed corners.
fromPdfArray(array: PdfArray)MatrixCreates a Matrix from a PDF array of six numbers.
toPdfArray()PdfArrayConverts this matrix to a PDF array of six numbers.
equals(o: Object)boolean
hashCode()int
toString()String

See Also

 English