Table of Contents

Struct Matrix

Namespace
MiPdf.Graphics
Assembly
MiPdf.dll

An affine transformation matrix [a b c d e f] as used by PDF (row vector convention).

public readonly record struct Matrix : IEquatable<Matrix>
Implements
Inherited Members

Constructors

Matrix(double, double, double, double, double, double)

An affine transformation matrix [a b c d e f] as used by PDF (row vector convention).

public Matrix(double A, double B, double C, double D, double E, double F)

Parameters

A double
B double
C double
D double
E double
F double

Fields

Identity

The identity matrix [1 0 0 1 0 0].

public static readonly Matrix Identity

Field Value

Matrix

Properties

A

public double A { get; init; }

Property Value

double

B

public double B { get; init; }

Property Value

double

C

public double C { get; init; }

Property Value

double

D

public double D { get; init; }

Property Value

double

E

public double E { get; init; }

Property Value

double

F

public double F { get; init; }

Property Value

double

Methods

Multiply(Matrix)

Returns this × other (first apply this, then other).

public Matrix Multiply(Matrix other)

Parameters

other Matrix

Returns

Matrix

Rotate(double)

Returns a rotation about the origin by degrees (counterclockwise in PDF's y-up space).

public static Matrix Rotate(double degrees)

Parameters

degrees double

Returns

Matrix

Scale(double, double)

Returns a scaling by sx horizontally and sy vertically.

public static Matrix Scale(double sx, double sy)

Parameters

sx double
sy double

Returns

Matrix

Transform(double, double)

Applies this matrix to the point (x, y).

public (double X, double Y) Transform(double x, double y)

Parameters

x double
y double

Returns

(double X, double Y)

Translate(double, double)

Returns a translation by (x, y).

public static Matrix Translate(double x, double y)

Parameters

x double
y double

Returns

Matrix