Show / Hide Table of Contents

Class CartesianUtils

Inheritance
System.Object
CartesianUtils
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: NFX.Geometry
Assembly: NFX.dll
Syntax
public static class CartesianUtils

Fields

PI_DEGREES

Represents count of degrees in PI

Declaration
public const double PI_DEGREES = 180
Field Value
Type Description
System.Double

PI_HALF

Pi/2 constant

Declaration
public const double PI_HALF = 1.5707963267948966
Field Value
Type Description
System.Double

PI2

Pi*2 constant

Declaration
public const double PI2 = 6.2831853071795862
Field Value
Type Description
System.Double

Methods

AngleToMapDirection(Double)

Converts a radian angular coordinate into map direction

Declaration
public static MapDirection AngleToMapDirection(double angle)
Parameters
Type Name Description
System.Double angle
Returns
Type Description
MapDirection

AzimuthDeg(Int32, Int32, Int32, Int32)

Calculates azimuth for vector in degrees

Declaration
public static double AzimuthDeg(int centerX, int centerY, int pointX, int pointY)
Parameters
Type Name Description
System.Int32 centerX
System.Int32 centerY
System.Int32 pointX
System.Int32 pointY
Returns
Type Description
System.Double

AzimuthOfRadix(Int32, Int32, Int32, Int32, Int32)

Calculates azimuth for vector in degrees

Declaration
public static int AzimuthOfRadix(int centerX, int centerY, int pointX, int pointY, int radix)
Parameters
Type Name Description
System.Int32 centerX
System.Int32 centerY
System.Int32 pointX
System.Int32 pointY
System.Int32 radix
Returns
Type Description
System.Int32

AzimuthRad(Int32, Int32, Int32, Int32)

Calculates azimuth for vector in rads

Declaration
public static double AzimuthRad(int centerX, int centerY, int pointX, int pointY)
Parameters
Type Name Description
System.Int32 centerX
System.Int32 centerY
System.Int32 pointX
System.Int32 pointY
Returns
Type Description
System.Double

CalculatePerimeterViolationArea(Rectangle, Rectangle)

Calculates an area of an inner rectangle that violates outside perimeter

Declaration
public static int CalculatePerimeterViolationArea(Rectangle perimeter, Rectangle inner)
Parameters
Type Name Description
System.Drawing.Rectangle perimeter
System.Drawing.Rectangle inner
Returns
Type Description
System.Int32

Distance(Point, Point)

Calculates distance between two points

Declaration
public static int Distance(Point p1, Point p2)
Parameters
Type Name Description
System.Drawing.Point p1
System.Drawing.Point p2
Returns
Type Description
System.Int32

Distance(PointF, PointF)

Calculates distance between two points

Declaration
public static float Distance(PointF p1, PointF p2)
Parameters
Type Name Description
System.Drawing.PointF p1
System.Drawing.PointF p2
Returns
Type Description
System.Single

Distance(Int32, Int32, Int32, Int32)

Calculates distance between two points

Declaration
public static int Distance(int x1, int y1, int x2, int y2)
Parameters
Type Name Description
System.Int32 x1
System.Int32 y1
System.Int32 x2
System.Int32 y2
Returns
Type Description
System.Int32

Distance(Single, Single, Single, Single)

Calculates distance between two points

Declaration
public static float Distance(float x1, float y1, float x2, float y2)
Parameters
Type Name Description
System.Single x1
System.Single y1
System.Single x2
System.Single y2
Returns
Type Description
System.Single

FindRayFromRectangleCenterSideIntersection(Rectangle, Double)

Returns a point of intersection between a ray cast from the center of a rectangle under certain polar coordinate angle and a rectangle side

Declaration
public static Point FindRayFromRectangleCenterSideIntersection(Rectangle rect, double theta)
Parameters
Type Name Description
System.Drawing.Rectangle rect
System.Double theta
Returns
Type Description
System.Drawing.Point

MapDirectionToAngle(MapDirection)

Converts map direction to angular coordinate in radians

Declaration
public static double MapDirectionToAngle(MapDirection direction)
Parameters
Type Name Description
MapDirection direction
Returns
Type Description
System.Double

PointToPolarPoint(Point, Point)

Converts Point to polar coordinate point

Declaration
public static PolarPoint PointToPolarPoint(Point center, Point point)
Parameters
Type Name Description
System.Drawing.Point center
System.Drawing.Point point
Returns
Type Description
PolarPoint

ToDeg(Double)

Converts radians into degrees

Declaration
public static double ToDeg(this double radians)
Parameters
Type Name Description
System.Double radians
Returns
Type Description
System.Double

ToRad(Double)

Converts degrees into radians

Declaration
public static double ToRad(this double degrees)
Parameters
Type Name Description
System.Double degrees
Returns
Type Description
System.Double

VectorToPolarPoint(Int32, Int32, Int32, Int32)

Converts vector in 'x1, y1, x2, y2' representation to polar coordinate point

Declaration
public static PolarPoint VectorToPolarPoint(int centerX, int centerY, int pointX, int pointY)
Parameters
Type Name Description
System.Int32 centerX
System.Int32 centerY
System.Int32 pointX
System.Int32 pointY
Returns
Type Description
PolarPoint

WrapAngle(Double, Double)

Modifies an angle by delta value ensuring that resulting angle is always between 0 and 2Pi

Declaration
public static double WrapAngle(double angle, double delta)
Parameters
Type Name Description
System.Double angle
System.Double delta
Returns
Type Description
System.Double
Back to top Copyright © 2006-2018 Agnicore Inc
Generated by DocFX