Class VectorMath
Functions for performing vector mathematics.
Inherited Members
Namespace: NetTopologySuite.Mathematics
Assembly: NetTopologySuite.dll
Syntax
public static class VectorMath
Methods
| Improve this Doc View SourceCrossProduct(Coordinate, Coordinate)
Computes the cross product of v1
and v2
Declaration
public static Coordinate CrossProduct(Coordinate v1, Coordinate v2)
Parameters
Type | Name | Description |
---|---|---|
Coordinate | v1 | A vector |
Coordinate | v2 | A vector |
Returns
Type | Description |
---|---|
Coordinate | The cross product of |
Det(Double, Double, Double, Double)
Computes the determinant of a 2x2 matrix
Declaration
public static double Det(double a1, double a2, double b1, double b2)
Parameters
Type | Name | Description |
---|---|---|
Double | a1 | The m[0,0] value |
Double | a2 | The m[0,1] value |
Double | b1 | The m[1,0] value |
Double | b2 | The m[1,1] value |
Returns
Type | Description |
---|---|
Double | The determinant |
DotProduct(Coordinate, Coordinate)
Computes the dot product of v1
and v2
Declaration
public static double DotProduct(Coordinate v1, Coordinate v2)
Parameters
Type | Name | Description |
---|---|---|
Coordinate | v1 | A vector |
Coordinate | v2 | A vector |
Returns
Type | Description |
---|---|
Double | The dot product of |
Normalize(Coordinate)
Normalizes the vector v
Declaration
public static void Normalize(Coordinate v)
Parameters
Type | Name | Description |
---|---|---|
Coordinate | v | The normalized |
NormalToTriangle(Coordinate, Coordinate, Coordinate)
Computes the normal vector to the triangle p0-p1-p2. In order to compute the normal each triangle coordinate must have a Z value. If this is not the case, the returned Coordinate will have NaN values. The returned vector has unit length.
Declaration
public static Coordinate NormalToTriangle(Coordinate p0, Coordinate p1, Coordinate p2)
Parameters
Type | Name | Description |
---|---|---|
Coordinate | p0 | A point |
Coordinate | p1 | A point |
Coordinate | p2 | A point |
Returns
Type | Description |
---|---|
Coordinate | The normal vector to the triangle |