C# Класс Loyc.Geometry.PointMath

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Abs ( this v ) : Vector

Gets the absolute value of the vector's individual components.

Abs ( this v ) : System.Vector3

Gets the absolute value of the vector's individual components.

Add ( this a, System.Point b ) : System.Point
Add ( this a, Vector b ) : System.Point
Add ( this a, Point3 b ) : Point3
Add ( this a, System.Vector3 b ) : Point3
Add ( this a, Vector b ) : Vector
Add ( this a, System.Vector3 b ) : System.Vector3
Angle ( this v ) : double

Gets the angle from 0 to 2*PI of the vector, where (1,0) has angle 0 and (0,1) has angle PI/2.

AngleDeg ( this v ) : double

Gets the angle from 0 to 360 of the vector, where (1,0) has angle 0 and (0,1) has angle 90.

ComputeConvexHull ( IEnumerable points ) : IListSource

Computes the convex hull of a polygon, in clockwise order in a Y-up coordinate system (counterclockwise in a Y-down coordinate system).

Uses the Monotone Chain algorithm, a.k.a. Andrew's Algorithm.

ComputeConvexHull ( List points, bool sortInPlace ) : IListSource
Cross ( this a, Vector b ) : T

Computes the "cross product" of a pair of 2D vectors.

This is not a general cross product, as cross product is only a 3D concept, but this operator acts as though the two points were in the Z=0 plane and returns the Z coordinate of the cross product: b.X * a.Y - b.Y * a.X. This value is zero if the vectors are parallel; it is a.Length * b.Length or -a.Length * b.Length if the vectors are perpendicular. One use of cross product is to determine whether the angle between two lines is greater or less than 180 degrees, corresponding to return values less or greater than zero.

Cross ( this a, System.Vector3 b ) : System.Vector3

Computes the cross product of a pair of 3D vectors.

Div ( this p, T factor ) : System.Point
Div ( this p, T factor ) : Point3
Div ( this p, T factor ) : Vector
Div ( this p, T factor ) : System.Vector3
Dot ( this a, Vector b ) : T

Dot product. a*b equals lhs.Length*rhs.Length*Cos(theta) if theta is the angle between two vectors.

Dot ( this a, System.Vector3 b ) : T
Length ( this v ) : T

Gets the length of the vector.

Mul ( this p, T factor ) : System.Point
Mul ( this p, T factor ) : Point3
Mul ( this p, T factor ) : Vector
Mul ( this p, T factor ) : System.Vector3
MulDiv ( this v, T mul, T div ) : Vector
MulDiv ( this v, T mul, T div ) : System.Vector3
Neg ( this a ) : Vector

Reverses a vector.

Neg ( this a ) : System.Vector3

Reverses a vector.

Normalized ( this v ) : Vector
Normalized ( this v ) : System.Vector3
PolarToPoint ( T magnitude, double radians ) : Point
PolarToVector ( T magnitude, double radians ) : Vector
Quadrance ( this v ) : T

Gets the square of the length of the vector.

Rot90 ( this a ) : Vector

Rotates a vector 90 degrees.

Rotatation is clockwise if increasing Y goes downward, counter- clockwise if increasing Y goes upward. If the vector represents the direction of a line, the result also represents the coefficients (a,b) of the implicit line equation aX + bY + c = 0.

Shl ( this p, int amt ) : System.Point
Shl ( this p, int amt ) : Point3
Shl ( this p, int amt ) : Vector
Shl ( this p, int amt ) : System.Vector3
Shr ( this p, int amt ) : System.Point
Shr ( this p, int amt ) : Point3
Shr ( this p, int amt ) : Vector
Shr ( this p, int amt ) : System.Vector3
Sub ( this a, Vector b ) : System.Point
Sub ( this a, System.Point b ) : Vector
Sub ( this a, Vector b ) : Vector
Sub ( this a, Point3 b ) : System.Vector3
Sub ( this a, System.Vector3 b ) : System.Vector3
Vector ( this seg ) : Vector

Returns seg.B - seg.A.

Описание методов

Abs() публичный статический Метод

Gets the absolute value of the vector's individual components.
public static Abs ( this v ) : Vector
v this
Результат Vector

Abs() публичный статический Метод

Gets the absolute value of the vector's individual components.
public static Abs ( this v ) : System.Vector3
v this
Результат System.Vector3

Add() публичный статический Метод

public static Add ( this a, System.Point b ) : System.Point
a this
b System.Point
Результат System.Point

Add() публичный статический Метод

public static Add ( this a, Vector b ) : System.Point
a this
b Vector
Результат System.Point

Add() публичный статический Метод

public static Add ( this a, Point3 b ) : Point3
a this
b Point3
Результат Point3

Add() публичный статический Метод

public static Add ( this a, System.Vector3 b ) : Point3
a this
b System.Vector3
Результат Point3

Add() публичный статический Метод

public static Add ( this a, Vector b ) : Vector
a this
b Vector
Результат Vector

Add() публичный статический Метод

public static Add ( this a, System.Vector3 b ) : System.Vector3
a this
b System.Vector3
Результат System.Vector3

Angle() публичный статический Метод

Gets the angle from 0 to 2*PI of the vector, where (1,0) has angle 0 and (0,1) has angle PI/2.
public static Angle ( this v ) : double
v this
Результат double

AngleDeg() публичный статический Метод

Gets the angle from 0 to 360 of the vector, where (1,0) has angle 0 and (0,1) has angle 90.
public static AngleDeg ( this v ) : double
v this
Результат double

ComputeConvexHull() публичный статический Метод

Computes the convex hull of a polygon, in clockwise order in a Y-up coordinate system (counterclockwise in a Y-down coordinate system).
Uses the Monotone Chain algorithm, a.k.a. Andrew's Algorithm.
public static ComputeConvexHull ( IEnumerable points ) : IListSource
points IEnumerable
Результат IListSource

ComputeConvexHull() публичный статический Метод

public static ComputeConvexHull ( List points, bool sortInPlace ) : IListSource
points List
sortInPlace bool
Результат IListSource

Cross() публичный статический Метод

Computes the "cross product" of a pair of 2D vectors.
This is not a general cross product, as cross product is only a 3D concept, but this operator acts as though the two points were in the Z=0 plane and returns the Z coordinate of the cross product: b.X * a.Y - b.Y * a.X. This value is zero if the vectors are parallel; it is a.Length * b.Length or -a.Length * b.Length if the vectors are perpendicular. One use of cross product is to determine whether the angle between two lines is greater or less than 180 degrees, corresponding to return values less or greater than zero.
public static Cross ( this a, Vector b ) : T
a this
b Vector
Результат T

Cross() публичный статический Метод

Computes the cross product of a pair of 3D vectors.
public static Cross ( this a, System.Vector3 b ) : System.Vector3
a this
b System.Vector3
Результат System.Vector3

Div() публичный статический Метод

public static Div ( this p, T factor ) : System.Point
p this
factor T
Результат System.Point

Div() публичный статический Метод

public static Div ( this p, T factor ) : Point3
p this
factor T
Результат Point3

Div() публичный статический Метод

public static Div ( this p, T factor ) : Vector
p this
factor T
Результат Vector

Div() публичный статический Метод

public static Div ( this p, T factor ) : System.Vector3
p this
factor T
Результат System.Vector3

Dot() публичный статический Метод

Dot product. a*b equals lhs.Length*rhs.Length*Cos(theta) if theta is the angle between two vectors.
public static Dot ( this a, Vector b ) : T
a this
b Vector
Результат T

Dot() публичный статический Метод

public static Dot ( this a, System.Vector3 b ) : T
a this
b System.Vector3
Результат T

Length() публичный статический Метод

Gets the length of the vector.
public static Length ( this v ) : T
v this
Результат T

Mul() публичный статический Метод

public static Mul ( this p, T factor ) : System.Point
p this
factor T
Результат System.Point

Mul() публичный статический Метод

public static Mul ( this p, T factor ) : Point3
p this
factor T
Результат Point3

Mul() публичный статический Метод

public static Mul ( this p, T factor ) : Vector
p this
factor T
Результат Vector

Mul() публичный статический Метод

public static Mul ( this p, T factor ) : System.Vector3
p this
factor T
Результат System.Vector3

MulDiv() публичный статический Метод

public static MulDiv ( this v, T mul, T div ) : Vector
v this
mul T
div T
Результат Vector

MulDiv() публичный статический Метод

public static MulDiv ( this v, T mul, T div ) : System.Vector3
v this
mul T
div T
Результат System.Vector3

Neg() публичный статический Метод

Reverses a vector.
public static Neg ( this a ) : Vector
a this
Результат Vector

Neg() публичный статический Метод

Reverses a vector.
public static Neg ( this a ) : System.Vector3
a this
Результат System.Vector3

Normalized() публичный статический Метод

public static Normalized ( this v ) : Vector
v this
Результат Vector

Normalized() публичный статический Метод

public static Normalized ( this v ) : System.Vector3
v this
Результат System.Vector3

PolarToPoint() публичный статический Метод

public static PolarToPoint ( T magnitude, double radians ) : Point
magnitude T
radians double
Результат Point

PolarToVector() публичный статический Метод

public static PolarToVector ( T magnitude, double radians ) : Vector
magnitude T
radians double
Результат Vector

Quadrance() публичный статический Метод

Gets the square of the length of the vector.
public static Quadrance ( this v ) : T
v this
Результат T

Rot90() публичный статический Метод

Rotates a vector 90 degrees.
Rotatation is clockwise if increasing Y goes downward, counter- clockwise if increasing Y goes upward. If the vector represents the direction of a line, the result also represents the coefficients (a,b) of the implicit line equation aX + bY + c = 0.
public static Rot90 ( this a ) : Vector
a this
Результат Vector

Shl() публичный статический Метод

public static Shl ( this p, int amt ) : System.Point
p this
amt int
Результат System.Point

Shl() публичный статический Метод

public static Shl ( this p, int amt ) : Point3
p this
amt int
Результат Point3

Shl() публичный статический Метод

public static Shl ( this p, int amt ) : Vector
p this
amt int
Результат Vector

Shl() публичный статический Метод

public static Shl ( this p, int amt ) : System.Vector3
p this
amt int
Результат System.Vector3

Shr() публичный статический Метод

public static Shr ( this p, int amt ) : System.Point
p this
amt int
Результат System.Point

Shr() публичный статический Метод

public static Shr ( this p, int amt ) : Point3
p this
amt int
Результат Point3

Shr() публичный статический Метод

public static Shr ( this p, int amt ) : Vector
p this
amt int
Результат Vector

Shr() публичный статический Метод

public static Shr ( this p, int amt ) : System.Vector3
p this
amt int
Результат System.Vector3

Sub() публичный статический Метод

public static Sub ( this a, Vector b ) : System.Point
a this
b Vector
Результат System.Point

Sub() публичный статический Метод

public static Sub ( this a, System.Point b ) : Vector
a this
b System.Point
Результат Vector

Sub() публичный статический Метод

public static Sub ( this a, Vector b ) : Vector
a this
b Vector
Результат Vector

Sub() публичный статический Метод

public static Sub ( this a, Point3 b ) : System.Vector3
a this
b Point3
Результат System.Vector3

Sub() публичный статический Метод

public static Sub ( this a, System.Vector3 b ) : System.Vector3
a this
b System.Vector3
Результат System.Vector3

Vector() публичный статический Метод

Returns seg.B - seg.A.
public static Vector ( this seg ) : Vector
seg this
Результат Vector