uPano  v3.1
InfinityCode.uPano.MathHelper Class Reference

Mathematical methods More...

Static Public Member Functions

static float Angle2D (Vector3 point1, Vector3 point2)
 The angle between the two points in degree More...
 
static float Angle2D (float p1x, float p1y, float p2x, float p2y)
 The angle between the two points in degree More...
 
static double Angle2D (double p1x, double p1y, double p2x, double p2y)
 The angle between the two points in degree More...
 
static bool IsPointInPolygon (List< Vector2 > poly, float x, float y)
 Checks if a point is inside a polygon More...
 
static Vector2 NearestPointStrict (Vector2 point, Vector2 lineStart, Vector2 lineEnd)
 Gets the nearest point on a line segment More...
 
static List< int > Triangulate (List< Vector3 > points)
 Triangulates a polygon More...
 

Static Public Attributes

const double Deg2Rad = Math.PI / 180
 Degrees-to-radians conversion constant. More...
 
const double Rad2Deg = 180 / Math.PI
 Radians-to-degrees conversion constant. More...
 
const double PID4 = Math.PI / 4
 Math.PI / 4 More...
 

Detailed Description

Mathematical methods

Member Function Documentation

◆ Angle2D() [1/3]

static double InfinityCode.uPano.MathHelper.Angle2D ( double  p1x,
double  p1y,
double  p2x,
double  p2y 
)
static

The angle between the two points in degree

Parameters
p1xPoint 1 X
p1yPoint 1 Y
p2xPoint 2 X
p2yPoint 2 Y
Returns
Angle in degree

◆ Angle2D() [2/3]

static float InfinityCode.uPano.MathHelper.Angle2D ( float  p1x,
float  p1y,
float  p2x,
float  p2y 
)
static

The angle between the two points in degree

Parameters
p1xPoint 1 X
p1yPoint 1 Y
p2xPoint 2 X
p2yPoint 2 Y
Returns
Angle in degree

◆ Angle2D() [3/3]

static float InfinityCode.uPano.MathHelper.Angle2D ( Vector3  point1,
Vector3  point2 
)
static

The angle between the two points in degree

Parameters
point1Point 1
point2Point 2
Returns
Angle in degree

◆ IsPointInPolygon()

static bool InfinityCode.uPano.MathHelper.IsPointInPolygon ( List< Vector2 >  poly,
float  x,
float  y 
)
static

Checks if a point is inside a polygon

Parameters
polyPolygon points list
xPoint X
yPoint Y
Returns
True - point inside the polygon, false - otherwise

◆ NearestPointStrict()

static Vector2 InfinityCode.uPano.MathHelper.NearestPointStrict ( Vector2  point,
Vector2  lineStart,
Vector2  lineEnd 
)
static

Gets the nearest point on a line segment

Parameters
pointThe point for which need to find the nearest point
lineStartSegment start point
lineEndSegment end point
Returns
Nearest point on a line segment

◆ Triangulate()

static List<int> InfinityCode.uPano.MathHelper.Triangulate ( List< Vector3 >  points)
static

Triangulates a polygon

Parameters
pointsPolygon point
Returns
List of vertex indices

Member Data Documentation

◆ Deg2Rad

const double InfinityCode.uPano.MathHelper.Deg2Rad = Math.PI / 180
static

Degrees-to-radians conversion constant.

◆ PID4

const double InfinityCode.uPano.MathHelper.PID4 = Math.PI / 4
static

Math.PI / 4

◆ Rad2Deg

const double InfinityCode.uPano.MathHelper.Rad2Deg = 180 / Math.PI
static

Radians-to-degrees conversion constant.