Class VectorMath
- Namespace
- NetTopologySuite.Mathematics
- Assembly
- NetTopologySuite.dll
Functions for performing vector mathematics.
public static class VectorMath
- Inheritance
-
VectorMath
- Inherited Members
Methods
CrossProduct(Coordinate, Coordinate)
Computes the cross product of v1
and v2
public static Coordinate CrossProduct(Coordinate v1, Coordinate v2)
Parameters
v1
CoordinateA vector
v2
CoordinateA vector
Returns
- Coordinate
The cross product of
v1
andv2
Det(double, double, double, double)
Computes the determinant of a 2x2 matrix
public static double Det(double a1, double a2, double b1, double b2)
Parameters
a1
doubleThe m[0,0] value
a2
doubleThe m[0,1] value
b1
doubleThe m[1,0] value
b2
doubleThe m[1,1] value
Returns
- double
The determinant
DotProduct(Coordinate, Coordinate)
Computes the dot product of v1
and v2
public static double DotProduct(Coordinate v1, Coordinate v2)
Parameters
v1
CoordinateA vector
v2
CoordinateA vector
Returns
- double
The dot product of
v1
andv2
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.
public static Coordinate NormalToTriangle(Coordinate p0, Coordinate p1, Coordinate p2)
Parameters
p0
CoordinateA point
p1
CoordinateA point
p2
CoordinateA point
Returns
- Coordinate
The normal vector to the triangle
p0
-p1
-p2
Normalize(Coordinate)
Normalizes the vector v
public static void Normalize(Coordinate v)
Parameters
v
CoordinateThe normalized
v