CMatrix:Normalize


The Normalize method normalizes the CMatrix to a volume of 1.0.

Syntax

CMatrix:Normalize()

Remarks

This method computes a scale factor to adjust the matrix values to a total sum of 1.0. This factor is applied to the CMatrix. If any matrix members are not numbers, the results are probably not meaningful.

Example

The following script normalizes the CMatrix:

M = new_matrix()

-- create a CMatrix

   ...

-- set the matrix weights

M:Normalize()

-- compute and apply the normalization factor

Printf("Vol = %lg", M:Volume())

-- result: Vol = 1

Related Topics

CMatrix class, Init


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics, Inc. All Rights Reserved.