C# Класс 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.
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
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.

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

Метод Описание
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

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

CalculateFacePlane() публичный Метод

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
Результат bool

FindNormalVector() публичный Метод

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
Результат void

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

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.
Результат double

GetVertexDistance() публичный Метод

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
Результат double

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

Squared length of the vector.
public static LengthSquared ( double x ) : double
x double
Результат double

MathHelper() публичный Метод

public MathHelper ( int dimension, double positions ) : System
dimension int
positions double
Результат System

SubtractFast() публичный Метод

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
Результат void