Class Algorithms
Inherited Members
Namespace: Mapsui.Utilities
Assembly: Mapsui.dll
Syntax
public static class Algorithms
Methods
| Edit this page View SourceDegreesToRadians(double)
Converts the specified angle from degrees to radians
Declaration
public static double DegreesToRadians(double degrees)
Parameters
Type | Name | Description |
---|---|---|
double | degrees | Angle to convert (degrees) |
Returns
Type | Description |
---|---|
double | Returns the angle in radians |
Distance(MPoint, MPoint)
Declaration
public static double Distance(MPoint a, MPoint b)
Parameters
Type | Name | Description |
---|---|---|
MPoint | a | |
MPoint | b |
Returns
Type | Description |
---|---|
double |
Distance(double, double, double, double)
Gets the euclidean distance between two points.
Declaration
public static double Distance(double x1, double y1, double x2, double y2)
Parameters
Type | Name | Description |
---|---|---|
double | x1 | The first point's X coordinate. |
double | y1 | The first point's Y coordinate. |
double | x2 | The second point's X coordinate. |
double | y2 | The second point's Y coordinate. |
Returns
Type | Description |
---|---|
double |
DistancePointLine(MPoint, MPoint, MPoint)
Computes the distance from a point p to a line segment AB. Note: NON-ROBUST!
Declaration
public static double DistancePointLine(MPoint p, MPoint a, MPoint b)
Parameters
Type | Name | Description |
---|---|---|
MPoint | p | The point to compute the distance for. |
MPoint | a | One point of the line. |
MPoint | b | Another point of the line (must be different to A). |
Returns
Type | Description |
---|---|
double | The distance from p to line segment AB. |
RadiansToDegrees(double)
Declaration
public static double RadiansToDegrees(double radians)
Parameters
Type | Name | Description |
---|---|---|
double | radians |
Returns
Type | Description |
---|---|
double |
RotateClockwiseDegrees(double, double, double)
Rotates the specified point clockwise about the origin
Declaration
public static MPoint RotateClockwiseDegrees(double x, double y, double degrees)
Parameters
Type | Name | Description |
---|---|---|
double | x | X coordinate to rotate |
double | y | Y coordinate to rotate |
double | degrees | Angle to rotate (degrees) |
Returns
Type | Description |
---|---|
MPoint | Returns the rotated point |
RotateClockwiseRadians(double, double, double)
Rotates the specified point clockwise about the origin
Declaration
public static MPoint RotateClockwiseRadians(double x, double y, double radians)
Parameters
Type | Name | Description |
---|---|---|
double | x | X coordinate to rotate |
double | y | Y coordinate to rotate |
double | radians | Angle to rotate (radians) |
Returns
Type | Description |
---|---|
MPoint | Returns the rotated point |