# MaplyMatrix

Objective-C

``@interface MaplyMatrix : NSObject``

Swift

``class MaplyMatrix : NSObject``

Represents a matrix for position manipulation.

Encapsulates a 4x4 matrix used for object placement and other things. This is more a wrapper than a full service object.

• ``` -initWithYaw:pitch:roll: ```

Construct with yaw, pitch, and roll parameters.

Construct the matrix with the standard yaw, pitch, and roll used by aircraft.

#### Declaration

Objective-C

``````- (nonnull instancetype)initWithYaw:(double)yaw
pitch:(double)pitch
roll:(double)roll;``````

Swift

``init(yaw: Double, pitch: Double, roll: Double)``
• ``` -initWithScale: ```

Construct with a consistent scale in each dimension.

Construct with the same scale in x,y, and z.

#### Declaration

Objective-C

``- (nonnull instancetype)initWithScale:(double)scale;``

Swift

``init(scale: Double)``
• ``` -initWithTranslateX:y:z: ```

Construct with a translation.

Construct with a translation in 3D.

#### Declaration

Objective-C

``- (nonnull instancetype)initWithTranslateX:(double)x y:(double)y z:(double)z;``

Swift

``init(translateX x: Double, y: Double, z: Double)``
• ``` -initWithAngle:axisX:axisY:axisZ: ```

Construct a rotation around the given axis.

Build a matrix that rotates the given amount (in radians) around the given axis.

#### Declaration

Objective-C

``````- (nonnull instancetype)initWithAngle:(double)ang
axisX:(double)x
axisY:(double)y
axisZ:(double)z;``````

Swift

``init(angle ang: Double, axisX x: Double, axisY y: Double, axisZ z: Double)``
• ``` -multiplyWith: ```

Multiply the given matrix with this one and return a new one.

Multiply the given matrix like so: ret = this * other. Return the new one.

#### Declaration

Objective-C

``- (nonnull instancetype)multiplyWith:(MaplyMatrix *_Nonnull)other;``

Swift

``func multiply(with other: MaplyMatrix) -> Self``