C# Класс SphericalHarmonics.SHFunctions

The functions gathered here allow to work with Spherical Harmonics and Zonal Harmonics =============================================================================== The convention for transformation between spherical and cartesian coordinates is : ( sinθ cosϕ, sinθ sinϕ, cosθ ) → (x, y, z) _ Azimuth ϕ is zero on +X and increases CCW (i.e. PI/2 at +Y, PI at -X and -PI/2 at -Y) _ Elevation θ is zero on +Z and PI on -Z Z θ=0 | | | ϕ=-PI/2 -Y - - - -o------+Y ϕ=PI/2 /. / . +X . ϕ=0 . -Z θ=PI So cartesian to polar coordinates is computed this way: θ = acos( Z ); ϕ = atan2( Y, X );
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
ALF double
EPS double
FACTORIAL double[]
ITMAX int
SQRT2 double
STPMX double
TOLX double
TOLY double

Открытые методы

Метод Описание
BuildRotationMatrix ( float3x3 _Rotation, double _Matrix, int _Order ) : void

Builds the matrix to apply the SH coefficients to make them rotate by the specified matrix

CartesianToSpherical ( float3 _Direction, double &, double & ) : void

Converts a cartesian UNIT vector into spherical coordinates (θ,ϕ)

ComputeClebschGordan ( int j1, int j2, int m1, int m2, int j, int m ) : double
ComputeRotatedZHCoefficients ( double _ZHCoefficients, float3 _TargetAxis, double _RotatedSHCoefficients ) : void

Computes the SH coefficients of originaly Y-aligned Zonal Harmonics coefficients rotated to match the provided axis

Be careful the returned coefficients are SH coefficients, hence the _RotatedSHCoefficients vector should be N² if rotating an order N Zonal Harmonics vector

ComputeSHWindowedCos ( int l, int m, double , double , int _Order ) : double
ComputeSHWindowedSinc ( int l, int m, double , double , int _Order ) : double
ComputeSigmaFactorCos ( int l, double h ) : double
ComputeSigmaFactorCos ( int l, int _Order ) : double

Sigma factor using a cardinal sine for windowing From "Real-time Soft Shadows in Dynamic Scenes using Spherical Harmonic Exponentiation" by Ren et al. (2006) Therefore, you should no longer use ComputeSH( l, m ) when reconstructing SH but ComputeSigmaFactorCos( l ) * ComputeSH( l, m )

ComputeSigmaFactorSinc ( int l, int _Order ) : double

Sigma factor using a cardinal sine for windowing From "A Quick Rendering Method Using Basis Functions for Interactive Lighting Design" by Dobashi et al. (1995) Therefore, you should no longer use ComputeSH( l, m ) when reconstructing SH but ComputeSigmaFactorSinc( l ) * ComputeSH( l, m )

ComputeZH ( int l, double ) : double
ComputeZH ( int l, float3 _Direction ) : double
Convolve ( float3 _Vector0, float3 _Vector1, int _Order ) : SharpMath.float3[]

Computes the convolution of 2 3-vectors of SH coefficients of the specified order using Clebsch-Gordan coefficients

This method is quite time-consuming as the convolution is computed using 5 loops but, as an optimisation, we can notice that most Clebsh-Gordan are 0 and a vector of non-null coefficients could be precomputed as only the vectors' coefficients change

EncodeIntoSH ( double _Coefficients, int _SamplesCountTheta, int _SamplesCountPhi, int _RandomSeed, int _Order, EvaluateFunctionSH _Delegate ) : void

Encodes a function evaluated by the provided delegate into a series of ZH coefficients

EncodeIntoSH ( float3 _Coefficients, int _SamplesCountTheta, int _SamplesCountPhi, int _RandomSeed, int _Order, EvaluateFunctionSHVector3 _Delegate ) : void

Encodes a function evaluated by the provided delegate into a series of ZH coefficients

EncodeIntoZH ( double _Coefficients, int _SamplesCount, int _RandomSeed, EvaluateFunctionZH _Delegate ) : void

Attempts to encode a function evaluated by the provided delegate into a series of ZH coefficients

EvaluateSH ( double _Coefficients, double , double , int _Order ) : double

Evaluates the amplitude encoded by the SH coefficients in the provided direction

EvaluateSH ( double _Coefficients, float3 _Direction, int _Order ) : double

Evaluates the amplitude encoded by the SH coefficients in the provided direction

EvaluateZH ( double _Coefficients, double ) : double

Evaluates the amplitude encoded by the Y-aligned ZH coefficients in the provided direction

EvaluateZH ( double _Coefficients, float3 _Direction ) : double

Evaluates the amplitude encoded by the Y-aligned ZH coefficients in the provided direction

FilterGaussian ( float _SH, int w ) : void
FilterGaussian ( float3 _SH, int w ) : void
FilterHanning ( float _SH, int w ) : void
FilterHanning ( float3 _SH, int w ) : void
FilterLanczos ( float _SH, int w ) : void
FilterLanczos ( float3 _SH, int w ) : void
InitializeSHCoefficients ( int _Order, double , double , double _Coefficients ) : void

Initializes the provided vector with the SH coefficients corresponding to the specified direction

InitializeSHCoefficients ( int _Order, double , double , float3 _Coefficients ) : void

Initializes the provided vector with the SH coefficients corresponding to the specified direction

InitializeSHCoefficients ( int _Order, float3 _Direction, double _Coefficients ) : void

Initializes the provided vector with the SH coefficients corresponding to the specified direction

InitializeSHCoefficients ( int _Order, float3 _Direction, float3 _Coefficients ) : void

Initializes the provided vector with the SH coefficients corresponding to the specified direction

K ( int l, int m ) : double
MapSHIntoZH ( double _SHCoefficients, int _Order, float2 _ZHAxes, double _ZHCoefficients, int _HemisphereResolution, int _FunctionSamplingResolution, double _BFGSConvergenceTolerance, double &_RMS, ZHMappingFeedback _Delegate ) : void

Performs mapping of a set of SH coefficients into N sets of ZH coefficients WARNING: Takes hell of a time to compute !

MirrorY ( double _Vector, double _MirroredVector, int _Order ) : void

Applies a simple mirroring on the Y axis

MirrorY ( float3 _Vector, float3 _MirroredVector, int _Order ) : void

Applies a simple mirroring on the Y axis

P ( int l, int m, double x ) : double
P0 ( int l, double x ) : double
Product3 ( double a, double b ) : double[]

Computes the product of 2 SH vectors of order 3 (code from John Snyder "Code Generation and Factoring for Fast Evaluation of Low-order Spherical Harmonic Products and Squares")

ProductClebschGordan ( double _Vector0, double _Vector1, int _Order, ProductDelegate _Delegate ) : double[]

Computes the product and re-projection in SH of 2 vectors of SH coefficients of the specified order using Clebsch-Gordan coefficients

This method is quite time-consuming as the convolution is computed using 5 loops but, as an optimisation, we can notice that most Clebsh-Gordan are 0 and a vector of non-null coefficients could be precomputed as only the SH vectors' coefficients change

Rotate ( double _Vector, double _RotationMatrix, double _RotatedVector, int _Order ) : void

Applies rotation to the specified SH vector using the specified rotation matrix yielded by the above "BuildRotationMatrix()" method

Rotate ( float3 _Vector, double _RotationMatrix, float3 _RotatedVector, int _Order ) : void

Applies rotation to the specified 3-vector using the specified rotation matrix returned by the "BuildRotationMatrix()" method

RotateY ( double _Vector, double , double _RotatedVector, int _Order ) : void

Applies a simple fast rotation about the Y axis

RotateY ( float3 _Vector, double , float3 _RotatedVector, int _Order ) : void

Applies a simple fast rotation about the Y axis

SphericalToCartesian ( double , double ) : float3

Converts spherical coordinates (θ,ϕ) into a cartesian UNIT vector

SphericalToCartesian ( double , double , float3 _Direction ) : void

Converts spherical coordinates (θ,ϕ) into a cartesian UNIT vector

Ylm ( int l, int m, double , double ) : double
Ylm ( int l, int m, float3 _Direction ) : double

Защищенные методы

Метод Описание
ComputeP ( int _a, int _b, int _i, int _l, double _Matrix ) : double

Factored code used to compute U,V,W coefficients needed for rotation matrix inference

ComputeRho ( int j1, int j2, int j ) : double
ComputeSigma ( int j1, int j2, int j, int m1, int m2, int m ) : double
ComputeSummedDifferences ( SHSamplesCollection _SamplesCollection, double _Normalizer, double _GoalSHEvaluation, double _SHEstimate, int _Order ) : double

Computes the square difference between a current SH estimate and a goal SH function given a set of samples

ComputeTau ( int j1, int j2, int j, int m1, int m2 ) : double
Factorial ( int _Value ) : double

Computes the factorial of the given integer value

ZHMappingGlobalFunctionEval ( double _Coefficients, object _Params ) : double
ZHMappingGlobalFunctionGradientEval ( double _Coefficients, double _Gradients, object _Params ) : void
ZHMappingLocalFunctionEval ( double _Coefficients, object _Params ) : double
ZHMappingLocalFunctionGradientEval ( double _Coefficients, double _Gradients, object _Params ) : void
dfpmin ( double _Coefficients, double _ConvergenceTolerance, int &_PerformedIterationsCount, double &_Minimum, BFGSFunctionEval _FunctionEval, BFGSFunctionGradientEval _FunctionGradientEval, object _Params ) : void

Performs BFGS function minimzation on a quadratic form function evaluated by the provided delegate

lnsrch ( int n, double xold, double fold, double g, double p, double x, double &f, double stpmax, int &check, BFGSFunctionEval _FunctionEval, object _Params ) : void

Приватные методы

Метод Описание
Filter ( float _SH, int l, float a ) : void
Filter ( float3 _SH, int l, float a ) : void
Ylm ( float3 _direction, double _SH ) : void

Computes the 9 Ylm coefficients for order 2 SH evaluated in the requested direction

Описание методов

BuildRotationMatrix() публичный статический Метод

Builds the matrix to apply the SH coefficients to make them rotate by the specified matrix
public static BuildRotationMatrix ( float3x3 _Rotation, double _Matrix, int _Order ) : void
_Rotation SharpMath.float3x3 The 3x3 rotation matrix to infer the SH rotation matrix from
_Matrix double The resulting _Order² x _Order² rotation matrix
_Order int The order of the SH vectors that will be rotated using the matrix
Результат void

CartesianToSpherical() публичный статический Метод

Converts a cartesian UNIT vector into spherical coordinates (θ,ϕ)
public static CartesianToSpherical ( float3 _Direction, double &, double & ) : void
_Direction SharpMath.float3 The cartesian unit vector to convert
double The polar elevation
double The azimuth
Результат void

ComputeClebschGordan() публичный статический Метод

public static ComputeClebschGordan ( int j1, int j2, int m1, int m2, int j, int m ) : double
j1 int
j2 int
m1 int
m2 int
j int
m int
Результат double

ComputeP() защищенный статический Метод

Factored code used to compute U,V,W coefficients needed for rotation matrix inference
protected static ComputeP ( int _a, int _b, int _i, int _l, double _Matrix ) : double
_a int
_b int
_i int
_l int
_Matrix double The source rotation matrix
Результат double

ComputeRho() защищенный статический Метод

protected static ComputeRho ( int j1, int j2, int j ) : double
j1 int
j2 int
j int
Результат double

ComputeRotatedZHCoefficients() публичный статический Метод

Computes the SH coefficients of originaly Y-aligned Zonal Harmonics coefficients rotated to match the provided axis
Be careful the returned coefficients are SH coefficients, hence the _RotatedSHCoefficients vector should be N² if rotating an order N Zonal Harmonics vector
public static ComputeRotatedZHCoefficients ( double _ZHCoefficients, float3 _TargetAxis, double _RotatedSHCoefficients ) : void
_ZHCoefficients double The ZH coefficients to rotate
_TargetAxis SharpMath.float3 The target axis to match (the original axis being positive Y)
_RotatedSHCoefficients double The rotated SH coefficients
Результат void

ComputeSHWindowedCos() публичный статический Метод

public static ComputeSHWindowedCos ( int l, int m, double , double , int _Order ) : double
l int
m int
double
double
_Order int
Результат double

ComputeSHWindowedSinc() публичный статический Метод

public static ComputeSHWindowedSinc ( int l, int m, double , double , int _Order ) : double
l int
m int
double
double
_Order int
Результат double

ComputeSigma() защищенный статический Метод

protected static ComputeSigma ( int j1, int j2, int j, int m1, int m2, int m ) : double
j1 int
j2 int
j int
m1 int
m2 int
m int
Результат double

ComputeSigmaFactorCos() публичный статический Метод

public static ComputeSigmaFactorCos ( int l, double h ) : double
l int
h double
Результат double

ComputeSigmaFactorCos() публичный статический Метод

Sigma factor using a cardinal sine for windowing From "Real-time Soft Shadows in Dynamic Scenes using Spherical Harmonic Exponentiation" by Ren et al. (2006) Therefore, you should no longer use ComputeSH( l, m ) when reconstructing SH but ComputeSigmaFactorCos( l ) * ComputeSH( l, m )
public static ComputeSigmaFactorCos ( int l, int _Order ) : double
l int Current band
_Order int Max used SH order
Результат double

ComputeSigmaFactorSinc() публичный статический Метод

Sigma factor using a cardinal sine for windowing From "A Quick Rendering Method Using Basis Functions for Interactive Lighting Design" by Dobashi et al. (1995) Therefore, you should no longer use ComputeSH( l, m ) when reconstructing SH but ComputeSigmaFactorSinc( l ) * ComputeSH( l, m )
public static ComputeSigmaFactorSinc ( int l, int _Order ) : double
l int Current band
_Order int Max used SH order
Результат double

ComputeSummedDifferences() защищенный статический Метод

Computes the square difference between a current SH estimate and a goal SH function given a set of samples
protected static ComputeSummedDifferences ( SHSamplesCollection _SamplesCollection, double _Normalizer, double _GoalSHEvaluation, double _SHEstimate, int _Order ) : double
_SamplesCollection SHSamplesCollection The collection of samples to use for the computation
_Normalizer double The normalizer for the final result
_GoalSHEvaluation double The goal SH function's evaluations for each sample
_SHEstimate double The estimate SH function's coefficients
_Order int The SH order
Результат double

ComputeTau() защищенный статический Метод

protected static ComputeTau ( int j1, int j2, int j, int m1, int m2 ) : double
j1 int
j2 int
j int
m1 int
m2 int
Результат double

ComputeZH() публичный статический Метод

public static ComputeZH ( int l, double ) : double
l int
double
Результат double

ComputeZH() публичный статический Метод

public static ComputeZH ( int l, float3 _Direction ) : double
l int
_Direction SharpMath.float3
Результат double

Convolve() публичный статический Метод

Computes the convolution of 2 3-vectors of SH coefficients of the specified order using Clebsch-Gordan coefficients
This method is quite time-consuming as the convolution is computed using 5 loops but, as an optimisation, we can notice that most Clebsh-Gordan are 0 and a vector of non-null coefficients could be precomputed as only the vectors' coefficients change
public static Convolve ( float3 _Vector0, float3 _Vector1, int _Order ) : SharpMath.float3[]
_Vector0 SharpMath.float3 First 3-vector
_Vector1 SharpMath.float3 Second 3-vector
_Order int The order of the vectors (i.e. vectors must have a length of Order²)
Результат SharpMath.float3[]

EncodeIntoSH() публичный статический Метод

Encodes a function evaluated by the provided delegate into a series of ZH coefficients
public static EncodeIntoSH ( double _Coefficients, int _SamplesCountTheta, int _SamplesCountPhi, int _RandomSeed, int _Order, EvaluateFunctionSH _Delegate ) : void
_Coefficients double The coefficients supposed to best fit the provided function (the length of the vector must be _Order²)
_SamplesCountTheta int
_SamplesCountPhi int
_RandomSeed int The random seed to initialize the RNG with when drawing random sample position
_Order int The order of the SH vector to encode
_Delegate EvaluateFunctionSH The delegate that will be called to evaluate the function to encode
Результат void

EncodeIntoSH() публичный статический Метод

Encodes a function evaluated by the provided delegate into a series of ZH coefficients
public static EncodeIntoSH ( float3 _Coefficients, int _SamplesCountTheta, int _SamplesCountPhi, int _RandomSeed, int _Order, EvaluateFunctionSHVector3 _Delegate ) : void
_Coefficients SharpMath.float3 The coefficients supposed to best fit the provided function (the length of the vector must be _Order²)
_SamplesCountTheta int
_SamplesCountPhi int
_RandomSeed int The random seed to initialize the RNG with when drawing random sample position
_Order int The order of the SH vector to encode
_Delegate EvaluateFunctionSHVector3 The delegate that will be called to evaluate the function to encode
Результат void

EncodeIntoZH() публичный статический Метод

Attempts to encode a function evaluated by the provided delegate into a series of ZH coefficients
public static EncodeIntoZH ( double _Coefficients, int _SamplesCount, int _RandomSeed, EvaluateFunctionZH _Delegate ) : void
_Coefficients double The coefficients supposed to best fit the provided function (the length of the vector will also provide the ZH/SH order)
_SamplesCount int The amount of samples to use to fit the function
_RandomSeed int The random seed to initialize the RNG with when drawing random sample position
_Delegate EvaluateFunctionZH The delegate that will be called to evaluate the function to encode
Результат void

EvaluateSH() публичный статический Метод

Evaluates the amplitude encoded by the SH coefficients in the provided direction
public static EvaluateSH ( double _Coefficients, double , double , int _Order ) : double
_Coefficients double The SH coefficients encoding an amplitude in various directions
double The elevation of the direction of the SH sampling
double The azimuth of the direction of the SH sampling
_Order int The order of the SH vector
Результат double

EvaluateSH() публичный статический Метод

Evaluates the amplitude encoded by the SH coefficients in the provided direction
public static EvaluateSH ( double _Coefficients, float3 _Direction, int _Order ) : double
_Coefficients double The SH coefficients encoding an amplitude in various directions
_Direction SharpMath.float3 The direction where to evalute the SH
_Order int The order of the SH vector
Результат double

EvaluateZH() публичный статический Метод

Evaluates the amplitude encoded by the Y-aligned ZH coefficients in the provided direction
public static EvaluateZH ( double _Coefficients, double ) : double
_Coefficients double The SH coefficients encoding an amplitude in various directions
double The elevation of the direction of the ZH sampling
Результат double

EvaluateZH() публичный статический Метод

Evaluates the amplitude encoded by the Y-aligned ZH coefficients in the provided direction
public static EvaluateZH ( double _Coefficients, float3 _Direction ) : double
_Coefficients double The SH coefficients encoding an amplitude in various directions
_Direction SharpMath.float3 The direction where to evalute the ZH
Результат double

Factorial() защищенный статический Метод

Computes the factorial of the given integer value
protected static Factorial ( int _Value ) : double
_Value int The value to compute the factorial of
Результат double

FilterGaussian() публичный статический Метод

public static FilterGaussian ( float _SH, int w ) : void
_SH float
w int
Результат void

FilterGaussian() публичный статический Метод

public static FilterGaussian ( float3 _SH, int w ) : void
_SH SharpMath.float3
w int
Результат void

FilterHanning() публичный статический Метод

public static FilterHanning ( float _SH, int w ) : void
_SH float
w int
Результат void

FilterHanning() публичный статический Метод

public static FilterHanning ( float3 _SH, int w ) : void
_SH SharpMath.float3
w int
Результат void

FilterLanczos() публичный статический Метод

public static FilterLanczos ( float _SH, int w ) : void
_SH float
w int
Результат void

FilterLanczos() публичный статический Метод

public static FilterLanczos ( float3 _SH, int w ) : void
_SH SharpMath.float3
w int
Результат void

InitializeSHCoefficients() публичный статический Метод

Initializes the provided vector with the SH coefficients corresponding to the specified direction
public static InitializeSHCoefficients ( int _Order, double , double , double _Coefficients ) : void
_Order int The order of the SH vector
double The elevation of the direction of the SH sampling
double The azimuth of the direction of the SH sampling
_Coefficients double The array of coefficients to fill up
Результат void

InitializeSHCoefficients() публичный статический Метод

Initializes the provided vector with the SH coefficients corresponding to the specified direction
public static InitializeSHCoefficients ( int _Order, double , double , float3 _Coefficients ) : void
_Order int The order of the SH vector
double The elevation of the direction of the SH sampling
double The azimuth of the direction of the SH sampling
_Coefficients SharpMath.float3 The array of coefficients to fill up
Результат void

InitializeSHCoefficients() публичный статический Метод

Initializes the provided vector with the SH coefficients corresponding to the specified direction
public static InitializeSHCoefficients ( int _Order, float3 _Direction, double _Coefficients ) : void
_Order int The order of the SH vector
_Direction SharpMath.float3 The direction of the SH sampling
_Coefficients double The array of coefficients to fill up
Результат void

InitializeSHCoefficients() публичный статический Метод

Initializes the provided vector with the SH coefficients corresponding to the specified direction
public static InitializeSHCoefficients ( int _Order, float3 _Direction, float3 _Coefficients ) : void
_Order int The order of the SH vector
_Direction SharpMath.float3 The direction of the SH sampling
_Coefficients SharpMath.float3 The array of coefficients to fill up
Результат void

K() публичный статический Метод

public static K ( int l, int m ) : double
l int
m int
Результат double

MapSHIntoZH() публичный статический Метод

Performs mapping of a set of SH coefficients into N sets of ZH coefficients WARNING: Takes hell of a time to compute !
public static MapSHIntoZH ( double _SHCoefficients, int _Order, float2 _ZHAxes, double _ZHCoefficients, int _HemisphereResolution, int _FunctionSamplingResolution, double _BFGSConvergenceTolerance, double &_RMS, ZHMappingFeedback _Delegate ) : void
_SHCoefficients double The SH coefficients to map into ZH
_Order int The order of the SH coefficients vector
_ZHAxes float2 The double array of resulting ZH axes (i.e. [θ,ϕ] couples)
_ZHCoefficients double The double array of resulting ZH coefficients (the dimension of the outter array gives the amount of requested ZH lobes while the dimension of the inner arrays should be of size "_Order")
_HemisphereResolution int The resolution of the hemisphere used to perform initial guess of directions (e.g. using a resolution of 100 will test for 20 * (4*20) possible lobe orientations)
_FunctionSamplingResolution int The resolution of the sphere used to perform function sampling and measuring the error (e.g. using a resolution of 100 will estimate the function with 100 * (2*100) samples)
_BFGSConvergenceTolerance double The convergence tolerance for the BFGS algorithm (the lower the tolerance, the longer it will compute)
_RMS double The resulting array of RMS errors for each ZH lobe
_Delegate ZHMappingFeedback An optional delegate to pass the method to get feedback about the mapping as it can be a lengthy process (!!)
Результат void

MirrorY() публичный статический Метод

Applies a simple mirroring on the Y axis
public static MirrorY ( double _Vector, double _MirroredVector, int _Order ) : void
_Vector double The vector to mirror
_MirroredVector double The mirrored vector
_Order int The order of the vectors (i.e. vectors must have a length of Order²)
Результат void

MirrorY() публичный статический Метод

Applies a simple mirroring on the Y axis
public static MirrorY ( float3 _Vector, float3 _MirroredVector, int _Order ) : void
_Vector SharpMath.float3 The vector to mirror
_MirroredVector SharpMath.float3 The mirrored vector
_Order int The order of the vectors (i.e. vectors must have a length of Order²)
Результат void

P() публичный статический Метод

public static P ( int l, int m, double x ) : double
l int
m int
x double
Результат double

P0() публичный статический Метод

public static P0 ( int l, double x ) : double
l int
x double
Результат double

Product3() публичный статический Метод

Computes the product of 2 SH vectors of order 3 (code from John Snyder "Code Generation and Factoring for Fast Evaluation of Low-order Spherical Harmonic Products and Squares")
public static Product3 ( double a, double b ) : double[]
a double
b double
Результат double[]

ProductClebschGordan() публичный статический Метод

Computes the product and re-projection in SH of 2 vectors of SH coefficients of the specified order using Clebsch-Gordan coefficients
This method is quite time-consuming as the convolution is computed using 5 loops but, as an optimisation, we can notice that most Clebsh-Gordan are 0 and a vector of non-null coefficients could be precomputed as only the SH vectors' coefficients change
public static ProductClebschGordan ( double _Vector0, double _Vector1, int _Order, ProductDelegate _Delegate ) : double[]
_Vector0 double First vector
_Vector1 double Second vector
_Order int The order of the vectors (i.e. vectors must have a length of Order²)
_Delegate ProductDelegate
Результат double[]

Rotate() публичный статический Метод

Applies rotation to the specified SH vector using the specified rotation matrix yielded by the above "BuildRotationMatrix()" method
public static Rotate ( double _Vector, double _RotationMatrix, double _RotatedVector, int _Order ) : void
_Vector double The vector to rotate
_RotationMatrix double The SH rotation matrix
_RotatedVector double The rotated vector
_Order int The order of the vectors (i.e. vectors must have a length of Order²)
Результат void

Rotate() публичный статический Метод

Applies rotation to the specified 3-vector using the specified rotation matrix returned by the "BuildRotationMatrix()" method
public static Rotate ( float3 _Vector, double _RotationMatrix, float3 _RotatedVector, int _Order ) : void
_Vector SharpMath.float3 The 3-vector to rotate
_RotationMatrix double The SH rotation matrix
_RotatedVector SharpMath.float3 The rotated vector
_Order int The order of the vectors (i.e. vectors must have a length of Order²)
Результат void

RotateY() публичный статический Метод

Applies a simple fast rotation about the Y axis
public static RotateY ( double _Vector, double , double _RotatedVector, int _Order ) : void
_Vector double The vector to rotate
double The rotation angle
_RotatedVector double The rotated vector
_Order int The order of the vectors (i.e. vectors must have a length of Order²)
Результат void

RotateY() публичный статический Метод

Applies a simple fast rotation about the Y axis
public static RotateY ( float3 _Vector, double , float3 _RotatedVector, int _Order ) : void
_Vector SharpMath.float3 The vector to rotate
double The rotation angle
_RotatedVector SharpMath.float3 The rotated vector
_Order int The order of the vectors (i.e. vectors must have a length of Order²)
Результат void

SphericalToCartesian() публичный статический Метод

Converts spherical coordinates (θ,ϕ) into a cartesian UNIT vector
public static SphericalToCartesian ( double , double ) : float3
double The polar elevation
double The azimuth
Результат SharpMath.float3

SphericalToCartesian() публичный статический Метод

Converts spherical coordinates (θ,ϕ) into a cartesian UNIT vector
public static SphericalToCartesian ( double , double , float3 _Direction ) : void
double The polar elevation
double The azimuth
_Direction SharpMath.float3 The unit vector in cartesian coordinates
Результат void

Ylm() публичный статический Метод

public static Ylm ( int l, int m, double , double ) : double
l int
m int
double
double
Результат double

Ylm() публичный статический Метод

public static Ylm ( int l, int m, float3 _Direction ) : double
l int
m int
_Direction SharpMath.float3
Результат double

ZHMappingGlobalFunctionEval() защищенный статический Метод

protected static ZHMappingGlobalFunctionEval ( double _Coefficients, object _Params ) : double
_Coefficients double
_Params object
Результат double

ZHMappingGlobalFunctionGradientEval() защищенный статический Метод

protected static ZHMappingGlobalFunctionGradientEval ( double _Coefficients, double _Gradients, object _Params ) : void
_Coefficients double
_Gradients double
_Params object
Результат void

ZHMappingLocalFunctionEval() защищенный статический Метод

protected static ZHMappingLocalFunctionEval ( double _Coefficients, object _Params ) : double
_Coefficients double
_Params object
Результат double

ZHMappingLocalFunctionGradientEval() защищенный статический Метод

protected static ZHMappingLocalFunctionGradientEval ( double _Coefficients, double _Gradients, object _Params ) : void
_Coefficients double
_Gradients double
_Params object
Результат void

dfpmin() защищенный статический Метод

Performs BFGS function minimzation on a quadratic form function evaluated by the provided delegate
protected static dfpmin ( double _Coefficients, double _ConvergenceTolerance, int &_PerformedIterationsCount, double &_Minimum, BFGSFunctionEval _FunctionEval, BFGSFunctionGradientEval _FunctionGradientEval, object _Params ) : void
_Coefficients double The array of initial coefficients (indexed from 1!!) that will also contain the resulting coefficients when the routine has converged
_ConvergenceTolerance double The tolerance error to accept as the minimum of the function
_PerformedIterationsCount int The amount of iterations performed to reach the minimum
_Minimum double The found minimum
_FunctionEval BFGSFunctionEval The delegate used to evaluate the function to minimize
_FunctionGradientEval BFGSFunctionGradientEval The delegate used to evaluate the gradient of the function to minimize
_Params object Some user params passed to the evaluation functions
Результат void

lnsrch() защищенный статический Метод

protected static lnsrch ( int n, double xold, double fold, double g, double p, double x, double &f, double stpmax, int &check, BFGSFunctionEval _FunctionEval, object _Params ) : void
n int
xold double
fold double
g double
p double
x double
f double
stpmax double
check int
_FunctionEval BFGSFunctionEval
_Params object
Результат void

Описание свойств

ALF защищенное статическое свойство

protected static double ALF
Результат double

EPS защищенное статическое свойство

protected static double EPS
Результат double

FACTORIAL защищенное статическое свойство

protected static double[] FACTORIAL
Результат double[]

ITMAX защищенное статическое свойство

protected static int ITMAX
Результат int

SQRT2 защищенное статическое свойство

protected static double SQRT2
Результат double

STPMX защищенное статическое свойство

protected static double STPMX
Результат double

TOLX защищенное статическое свойство

protected static double TOLX
Результат double

TOLY защищенное статическое свойство

protected static double TOLY
Результат double