Record TGenericMatrix3

Unit

Declaration

type TGenericMatrix3 = record

Description

3x3 matrix of floating-point values. Column-major, just like OpenGL, which means that the first index of Data array should be treated as a column number, the 2nd index is the row number.

This is generic type (although not using "proper" Pascal generics for implementation reasons). In has two actual uses:

  1. TMatrix3, a matrix of 3 Single values (floats with single precision),

  2. TMatrix3Double, a matrix of 3 Double values (floats with double precision).

The type TGenericScalar is, accordingly, Single or Double for TMatrix3 or TMatrix3Double.

Source: base/castlevectors_generic_float_record.inc (line 554).

Overview

Nested Types

Public TIndex = 0..2;
Public TIndexArray = array[TIndex] of TGenericScalar;

Fields

Public var Data: array [TIndex] of TIndexArray;

Methods

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

Properties

Public property Items [const AColumn,ARow: TIndex]: TGenericScalar read GetItems write SetItems;
Public property Rows [const ARow: TIndex]: TGenericVector3 read GetRows write SetRows;
Public property Columns [const AColumn: TIndex]: TGenericVector3 read GetColumns write SetColumns;

Description

Nested Types

Public TIndex = 0..2;

This item has no description.

Source: base/castlevectors_generic_float_record.inc (line 554).

Public TIndexArray = array[TIndex] of TGenericScalar;

This item has no description.

Source: base/castlevectors_generic_float_record.inc (line 554).

Fields

Public var Data: array [TIndex] of TIndexArray;

Data: array [TIndex, TIndex] of TGenericScalar;

Source: base/castlevectors_generic_float_record.inc (line 570).

Methods

Public class operator + (const A, B: TGenericMatrix3): TGenericMatrix3; inline;

This item has no description.

Source: base/castlevectors_generic_float_record.inc (line 572).

Public class operator - (const A, B: TGenericMatrix3): TGenericMatrix3; inline;

This item has no description.

Source: base/castlevectors_generic_float_record.inc (line 573).

Public class operator - (const M: TGenericMatrix3): TGenericMatrix3; inline;

This item has no description.

Source: base/castlevectors_generic_float_record.inc (line 574).

Public class operator * (const V: TGenericMatrix3; const Scalar: TGenericScalar): TGenericMatrix3; inline;

This item has no description.

Source: base/castlevectors_generic_float_record.inc (line 575).

Public class operator * (const Scalar: TGenericScalar; const V: TGenericMatrix3): TGenericMatrix3; inline;

This item has no description.

Source: base/castlevectors_generic_float_record.inc (line 576).

Public class operator * (const M: TGenericMatrix3; const V: TGenericVector3): TGenericVector3; inline;

This item has no description.

Source: base/castlevectors_generic_float_record.inc (line 577).

Public class operator * (const M1, M2: TGenericMatrix3): TGenericMatrix3;

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.

Source: base/castlevectors_generic_float_record.inc (line 582).

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

Convert to multi-line string.

The output follows the natural mathematical look of the matrix, so the first line shows the firt row, and so on. This matches X3D matrix notation and contrasts with VRML 1.0 notation.

Source: base/castlevectors_generic_float_record.inc (line 589).

Public function ToRawString(const LineIndent: String = ''; const FloatFormat: String = '%g'): String;

Convert to multi-line 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.

You can pass, as parameter, the format to use. By default it is '%g', "general number format" with maximum precision documented on https://www.freepascal.org/docs-html/rtl/sysutils/format.html .

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

Source: base/castlevectors_generic_float_record.inc (line 602).

Public function Determinant: TGenericScalar;

This item has no description.

Source: base/castlevectors_generic_float_record.inc (line 607).

Public function Inverse(ADeterminant: TGenericScalar): TGenericMatrix3;

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.

Source: base/castlevectors_generic_float_record.inc (line 614).

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

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

Source: base/castlevectors_generic_float_record.inc (line 617).

Public function Transpose: TGenericMatrix3;

This item has no description.

Source: base/castlevectors_generic_float_record.inc (line 619).

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

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

Source: base/castlevectors_generic_float_record.inc (line 622).

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

This item has no description.

Source: base/castlevectors_generic_float_record.inc (line 623).

Public class function PerfectlyEquals(const M1, M2: TGenericMatrix3): boolean; static;

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

Source: base/castlevectors_generic_float_record.inc (line 626).

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

Linear interpolation between two matrix values.

See also
TGenericVector3.Lerp
Linear interpolation between two vector values.

Source: base/castlevectors_generic_float_record.inc (line 630).

Public class function Zero: TGenericMatrix3; static;

This item has no description.

Source: base/castlevectors_generic_float_record.inc (line 632).

Public class function Identity: TGenericMatrix3; static;

This item has no description.

Source: base/castlevectors_generic_float_record.inc (line 633).

Properties

Public property Items [const AColumn,ARow: TIndex]: TGenericScalar read GetItems write SetItems;

This item has no description.

Source: base/castlevectors_generic_float_record.inc (line 604).

Public property Rows [const ARow: TIndex]: TGenericVector3 read GetRows write SetRows;

This item has no description.

Source: base/castlevectors_generic_float_record.inc (line 605).

Public property Columns [const AColumn: TIndex]: TGenericVector3 read GetColumns write SetColumns;

This item has no description.

Source: base/castlevectors_generic_float_record.inc (line 606).


Generated by PasDoc 0.17.0.snapshot.