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
dx
The X-coefficient of the translation.
dy
The 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
sx
The X-coefficient of the scale.
sy
The 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
angle
The angle of rotation.
pivotX
The X-coordinate of the pivot point.
pivotY
The 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
angle
The angle of rotation.
-
Transforms the specified rectangle by this Matrix.
Parameters
rect
The rectangle to transform.
Return Value
The transformed rectangle.
-
Maps the coordinate system of the source rectangle to that of the destination rectangle.
Declaration
Parameters
sourceRect
The source rectangle.
targetRect
The 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]