Matrix
public struct Matrix
Represents a matrix.
-
Initializes a new instance of the Matrix structure.
Declaration
Swift
public init()Return Value
The newly created Matrix object.
-
Translates the elements of this Matrix with the specified x and y coefficients.
Declaration
Swift
public mutating func translate(_ dx: Double, dy: Double)Parameters
dxThe X-coefficient of the translation.
dyThe Y-coefficient of the translation.
-
Scales the elements of this Matrix with the specified x and y coefficients.
Declaration
Swift
public mutating func scale(_ sx: Double, sy: Double)Parameters
sxThe X-coefficient of the scale.
syThe Y-coefficient of the scale.
-
Undocumented
Declaration
Swift
public mutating func scaleAtCenter(_ sx: Double, sy: Double, rect: Rect) -
Rotates the elements of this Matrix at the specified angle around the specified pivot.
Declaration
Swift
public mutating func rotateAt(_ angle: Double, pivotX: Double, pivotY: Double)Parameters
angleThe angle of rotation.
pivotXThe X-coordinate of the pivot point.
pivotYThe Y-coordinate of the pivot point.
-
Rotates the elements of this Matrix at the specified angle.
Declaration
Swift
public mutating func rotateAt(_ angle: Double)Parameters
angleThe angle of rotation.
-
Transforms the specified rectangle by this Matrix.
Parameters
rectThe rectangle to transform.
Return Value
The transformed rectangle.
-
Maps the coordinate system of the source rectangle to that of the destination rectangle.
Declaration
Parameters
sourceRectThe source rectangle.
targetRectThe target rectangle.
Return Value
The transformation Matrix.
-
Undocumented
Declaration
Swift
public static func multiply(_ m1: Matrix, _ m2: Matrix) -> Matrix -
The elements of the Matrix.
Declaration
Swift
public var elements: [Double]
Matrix Structure Reference