C# Class MIConvexHull.MathHelper

A helper class mostly for normal computation. If convex hulls are computed in higher dimensions, it might be a good idea to add a specific FindNormalVectorND function.
Afficher le fichier Open project: gusmanb/MIConvexHull Class Usage Examples

Méthodes publiques

Méthode Description
CalculateFacePlane ( ConvexFaceInternal face, double center ) : bool

Calculates the normal and offset of the hyper-plane given by the face's vertices.

FindNormalVector ( int vertices, double normalData ) : void

Finds normal vector of a hyper-plane given by vertices. Stores the results to normalData.

GetSimplexVolume ( ConvexFaceInternal cell, IList vertices, SimplexVolumeBuffer buffer ) : double

Computes the volume of an n-dimensional simplex. Buffer needs to be array of shape Dimension x Dimension.

GetVertexDistance ( int v, ConvexFaceInternal f ) : double

Check if the vertex is "visible" from the face. The vertex is "over face" if the return value is > Constants.PlaneDistanceTolerance.

LengthSquared ( double x ) : double

Squared length of the vector.

MathHelper ( int dimension, double positions ) : System
SubtractFast ( int x, int y, double target ) : void

Subtracts vectors x and y and stores the result to target.

Private Methods

Méthode Description
DeterminantDestructive ( SimplexVolumeBuffer buff ) : double
FindNormal ( int vertices, double normal ) : void
FindNormalVector2D ( int vertices, double normal ) : void

Finds 2D normal vector.

FindNormalVector3D ( int vertices, double normal ) : void

Finds 3D normal vector.

FindNormalVector4D ( int vertices, double normal ) : void

Finds 4D normal vector.

FindNormalVectorND ( int vertices, double normal ) : void
LUFactor ( double data, int order, int ipiv, double vecLUcolj ) : void

Method Details

CalculateFacePlane() public méthode

Calculates the normal and offset of the hyper-plane given by the face's vertices.
public CalculateFacePlane ( ConvexFaceInternal face, double center ) : bool
face ConvexFaceInternal
center double
Résultat bool

FindNormalVector() public méthode

Finds normal vector of a hyper-plane given by vertices. Stores the results to normalData.
public FindNormalVector ( int vertices, double normalData ) : void
vertices int
normalData double
Résultat void

GetSimplexVolume() public static méthode

Computes the volume of an n-dimensional simplex. Buffer needs to be array of shape Dimension x Dimension.
public static GetSimplexVolume ( ConvexFaceInternal cell, IList vertices, SimplexVolumeBuffer buffer ) : double
cell ConvexFaceInternal
vertices IList
buffer SimplexVolumeBuffer Helper for the calculation to avoid unnecessary allocations.
Résultat double

GetVertexDistance() public méthode

Check if the vertex is "visible" from the face. The vertex is "over face" if the return value is > Constants.PlaneDistanceTolerance.
public GetVertexDistance ( int v, ConvexFaceInternal f ) : double
v int
f ConvexFaceInternal
Résultat double

LengthSquared() public static méthode

Squared length of the vector.
public static LengthSquared ( double x ) : double
x double
Résultat double

MathHelper() public méthode

public MathHelper ( int dimension, double positions ) : System
dimension int
positions double
Résultat System

SubtractFast() public méthode

Subtracts vectors x and y and stores the result to target.
public SubtractFast ( int x, int y, double target ) : void
x int
y int
target double
Résultat void