Show / Hide Table of Contents

    Class Algorithms

    Inheritance
    System.Object
    Algorithms
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Mapsui.Geometries.Utilities
    Assembly: Mapsui.Geometries.dll
    Syntax
    public static class Algorithms

    Methods

    | Improve this Doc View Source

    DegreesToRadians(Double)

    Converts the specified angle from degrees to radians

    Declaration
    public static double DegreesToRadians(double degrees)
    Parameters
    Type Name Description
    System.Double degrees

    Angle to convert (degrees)

    Returns
    Type Description
    System.Double

    Returns the angle in radians

    | Improve this Doc View Source

    Distance(Point, Point)

    Declaration
    public static double Distance(Point a, Point b)
    Parameters
    Type Name Description
    Point a
    Point b
    Returns
    Type Description
    System.Double
    | Improve this Doc View Source

    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
    System.Double x1

    The first point's X coordinate.

    System.Double y1

    The first point's Y coordinate.

    System.Double x2

    The second point's X coordinate.

    System.Double y2

    The second point's Y coordinate.

    Returns
    Type Description
    System.Double
    | Improve this Doc View Source

    DistanceToLine(Point, IList<Point>)

    Declaration
    public static double DistanceToLine(Point point, IList<Point> points)
    Parameters
    Type Name Description
    Point point
    System.Collections.Generic.IList<Point> points
    Returns
    Type Description
    System.Double
    | Improve this Doc View Source

    GetDistanceAndSegmentIndex(Point, IList<Point>)

    Returns the shortest distance to a line and also the index of the segment with that shortest distance. Segments count from zero to vertex count - 1.

    Declaration
    public static (double Distance, int Segment) GetDistanceAndSegmentIndex(Point point, IList<Point> points)
    Parameters
    Type Name Description
    Point point
    System.Collections.Generic.IList<Point> points
    Returns
    Type Description
    System.ValueTuple<System.Double, System.Int32>
    | Improve this Doc View Source

    IsCCW(LinearRing)

    Tests whether a ring is oriented counter-clockwise.

    Declaration
    public static bool IsCCW(LinearRing ring)
    Parameters
    Type Name Description
    LinearRing ring

    Ring to test.

    Returns
    Type Description
    System.Boolean

    Returns true if ring is oriented counter-clockwise.

    | Improve this Doc View Source

    PointInPolygon(IList<Point>, Point)

    Declaration
    public static bool PointInPolygon(IList<Point> ring, Point point)
    Parameters
    Type Name Description
    System.Collections.Generic.IList<Point> ring
    Point point
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    RotateClockwiseDegrees(Double, Double, Double)

    Rotates the specified point clockwise about the origin

    Declaration
    public static Point RotateClockwiseDegrees(double x, double y, double degrees)
    Parameters
    Type Name Description
    System.Double x

    X coordinate to rotate

    System.Double y

    Y coordinate to rotate

    System.Double degrees

    Angle to rotate (degrees)

    Returns
    Type Description
    Point

    Returns the rotated point

    | Improve this Doc View Source

    RotateClockwiseRadians(Double, Double, Double)

    Rotates the specified point clockwise about the origin

    Declaration
    public static Point RotateClockwiseRadians(double x, double y, double radians)
    Parameters
    Type Name Description
    System.Double x

    X coordinate to rotate

    System.Double y

    Y coordinate to rotate

    System.Double radians

    Angle to rotate (radians)

    Returns
    Type Description
    Point

    Returns the rotated point

    • Improve this Doc
    • View Source
    Back to top Generated by DocFX