Record TGenericMatrix2

Unit

Declaration

type TGenericMatrix2 = record

Description

2x2 matrix of floating-point values.

See also
TGenericMatrix3
3x3 matrix of floating-point values.

Overview

Nested Types

Public TIndex = 0..1;

Fields

Public var Data: array [TIndex, TIndex] of TGenericScalar;

Methods

Public class operator + (const A, B: TGenericMatrix2): TGenericMatrix2; inline;
Public class operator - (const A, B: TGenericMatrix2): TGenericMatrix2; inline;
Public class operator - (const M: TGenericMatrix2): TGenericMatrix2; inline;
Public class operator * (const V: TGenericMatrix2; const Scalar: TGenericScalar): TGenericMatrix2; inline;
Public class operator * (const Scalar: TGenericScalar; const V: TGenericMatrix2): TGenericMatrix2; inline;
Public class operator * (const M: TGenericMatrix2; const V: TGenericVector2): TGenericVector2; inline;
Public class operator * (const M1, M2: TGenericMatrix2): TGenericMatrix2;
Public function ToString(const LineIndent: string = ''): string;
Public function ToRawString(const LineIndent: string = ''): string;
Public function Determinant: TGenericScalar;
Public function Inverse(ADeterminant: TGenericScalar): TGenericMatrix2;
Public function TryInverse(out MInverse: TGenericMatrix2): boolean;
Public function Transpose: TGenericMatrix2;
Public class function Equals(const M1, M2: TGenericMatrix2): boolean; overload; static;
Public class function Equals(const M1, M2: TGenericMatrix2; const Epsilon: TGenericScalar): boolean; overload; static;
Public class function PerfectlyEquals(const M1, M2: TGenericMatrix2): boolean; static;
Public class function Lerp(const A: TGenericScalar; const M1, M2: TGenericMatrix2): TGenericMatrix2; static;
Public class function Zero: TGenericMatrix2; static;
Public class function Identity: TGenericMatrix2; static;

Properties

Public property Items [constAColumn,ARow:TIndex]: TGenericScalar read GetItems write SetItems;
Public property Rows [constARow:TIndex]: TGenericVector2 read GetRows write SetRows;
Public property Columns [constAColumn:TIndex]: TGenericVector2 read GetColumns write SetColumns;

Description

Nested Types

Public TIndex = 0..1;
 

Fields

Public var Data: array [TIndex, TIndex] of TGenericScalar;
 

Methods

Public class operator + (const A, B: TGenericMatrix2): TGenericMatrix2; inline;
 
Public class operator - (const A, B: TGenericMatrix2): TGenericMatrix2; inline;
 
Public class operator - (const M: TGenericMatrix2): TGenericMatrix2; inline;
 
Public class operator * (const V: TGenericMatrix2; const Scalar: TGenericScalar): TGenericMatrix2; inline;
 
Public class operator * (const Scalar: TGenericScalar; const V: TGenericMatrix2): TGenericMatrix2; inline;
 
Public class operator * (const M: TGenericMatrix2; const V: TGenericVector2): TGenericVector2; inline;
 
Public class operator * (const M1, M2: TGenericMatrix2): TGenericMatrix2;

Matrix * matrix makes a normal matrix algebraic multiplication (not component-wise multiplication). Note that this is different from vectors, where vector * vector makes a component-wise multiplication.

Public function ToString(const LineIndent: string = ''): string;
 
Public function ToRawString(const LineIndent: string = ''): string;

Convert to string using the most precise (not always easily readable by humans) float format. This may use the exponential (scientific) notation to represent the floating-point value, if needed.

This is suitable for storing the value in a file, with a best precision possible.

Public function Determinant: TGenericScalar;
 
Public function Inverse(ADeterminant: TGenericScalar): TGenericMatrix2;

Inverse the matrix.

This does division by ADeterminant internally, so will raise exception from this float division if the matrix is not reversible. Check Math.IsZero(ADeterminant) first to avoid this, or use TryInverse.

Public function TryInverse(out MInverse: TGenericMatrix2): boolean;

Inverse the matrix, or return False if the matrix is not invertible.

Public function Transpose: TGenericMatrix2;
 
Public class function Equals(const M1, M2: TGenericMatrix2): boolean; overload; static;

Compare two vectors, with epsilon to tolerate slightly different floats.

Public class function Equals(const M1, M2: TGenericMatrix2; const Epsilon: TGenericScalar): boolean; overload; static;
 
Public class function PerfectlyEquals(const M1, M2: TGenericMatrix2): boolean; static;

Compare two vectors using exact comparison (like the "=" operator to compare floats).

Public class function Lerp(const A: TGenericScalar; const M1, M2: TGenericMatrix2): TGenericMatrix2; static;

Linear interpolation between two matrix values.

See also
TGenericVector3.Lerp
Linear interpolation between two vector values.
Public class function Zero: TGenericMatrix2; static;
 
Public class function Identity: TGenericMatrix2; static;
 

Properties

Public property Items [constAColumn,ARow:TIndex]: TGenericScalar read GetItems write SetItems;
 
Public property Rows [constARow:TIndex]: TGenericVector2 read GetRows write SetRows;
 
Public property Columns [constAColumn:TIndex]: TGenericVector2 read GetColumns write SetColumns;
 

Generated by PasDoc 0.16.0.