C# Class Loyc.Geometry.PointMath

Afficher le fichier Open project: qwertie/ecsharp Class Usage Examples

Méthodes publiques

Méthode Description
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.

Method Details

Abs() public static méthode

Gets the absolute value of the vector's individual components.
public static Abs ( this v ) : Vector
v this
Résultat Vector

Abs() public static méthode

Gets the absolute value of the vector's individual components.
public static Abs ( this v ) : System.Vector3
v this
Résultat System.Vector3

Add() public static méthode

public static Add ( this a, System.Point b ) : System.Point
a this
b System.Point
Résultat System.Point

Add() public static méthode

public static Add ( this a, Vector b ) : System.Point
a this
b Vector
Résultat System.Point

Add() public static méthode

public static Add ( this a, Point3 b ) : Point3
a this
b Point3
Résultat Point3

Add() public static méthode

public static Add ( this a, System.Vector3 b ) : Point3
a this
b System.Vector3
Résultat Point3

Add() public static méthode

public static Add ( this a, Vector b ) : Vector
a this
b Vector
Résultat Vector

Add() public static méthode

public static Add ( this a, System.Vector3 b ) : System.Vector3
a this
b System.Vector3
Résultat System.Vector3

Angle() public static méthode

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
Résultat double

AngleDeg() public static méthode

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
Résultat double

ComputeConvexHull() public static méthode

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
Résultat IListSource

ComputeConvexHull() public static méthode

public static ComputeConvexHull ( List points, bool sortInPlace ) : IListSource
points List
sortInPlace bool
Résultat IListSource

Cross() public static méthode

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
Résultat T

Cross() public static méthode

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
Résultat System.Vector3

Div() public static méthode

public static Div ( this p, T factor ) : System.Point
p this
factor T
Résultat System.Point

Div() public static méthode

public static Div ( this p, T factor ) : Point3
p this
factor T
Résultat Point3

Div() public static méthode

public static Div ( this p, T factor ) : Vector
p this
factor T
Résultat Vector

Div() public static méthode

public static Div ( this p, T factor ) : System.Vector3
p this
factor T
Résultat System.Vector3

Dot() public static méthode

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
Résultat T

Dot() public static méthode

public static Dot ( this a, System.Vector3 b ) : T
a this
b System.Vector3
Résultat T

Length() public static méthode

Gets the length of the vector.
public static Length ( this v ) : T
v this
Résultat T

Mul() public static méthode

public static Mul ( this p, T factor ) : System.Point
p this
factor T
Résultat System.Point

Mul() public static méthode

public static Mul ( this p, T factor ) : Point3
p this
factor T
Résultat Point3

Mul() public static méthode

public static Mul ( this p, T factor ) : Vector
p this
factor T
Résultat Vector

Mul() public static méthode

public static Mul ( this p, T factor ) : System.Vector3
p this
factor T
Résultat System.Vector3

MulDiv() public static méthode

public static MulDiv ( this v, T mul, T div ) : Vector
v this
mul T
div T
Résultat Vector

MulDiv() public static méthode

public static MulDiv ( this v, T mul, T div ) : System.Vector3
v this
mul T
div T
Résultat System.Vector3

Neg() public static méthode

Reverses a vector.
public static Neg ( this a ) : Vector
a this
Résultat Vector

Neg() public static méthode

Reverses a vector.
public static Neg ( this a ) : System.Vector3
a this
Résultat System.Vector3

Normalized() public static méthode

public static Normalized ( this v ) : Vector
v this
Résultat Vector

Normalized() public static méthode

public static Normalized ( this v ) : System.Vector3
v this
Résultat System.Vector3

PolarToPoint() public static méthode

public static PolarToPoint ( T magnitude, double radians ) : Point
magnitude T
radians double
Résultat Point

PolarToVector() public static méthode

public static PolarToVector ( T magnitude, double radians ) : Vector
magnitude T
radians double
Résultat Vector

Quadrance() public static méthode

Gets the square of the length of the vector.
public static Quadrance ( this v ) : T
v this
Résultat T

Rot90() public static méthode

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
Résultat Vector

Shl() public static méthode

public static Shl ( this p, int amt ) : System.Point
p this
amt int
Résultat System.Point

Shl() public static méthode

public static Shl ( this p, int amt ) : Point3
p this
amt int
Résultat Point3

Shl() public static méthode

public static Shl ( this p, int amt ) : Vector
p this
amt int
Résultat Vector

Shl() public static méthode

public static Shl ( this p, int amt ) : System.Vector3
p this
amt int
Résultat System.Vector3

Shr() public static méthode

public static Shr ( this p, int amt ) : System.Point
p this
amt int
Résultat System.Point

Shr() public static méthode

public static Shr ( this p, int amt ) : Point3
p this
amt int
Résultat Point3

Shr() public static méthode

public static Shr ( this p, int amt ) : Vector
p this
amt int
Résultat Vector

Shr() public static méthode

public static Shr ( this p, int amt ) : System.Vector3
p this
amt int
Résultat System.Vector3

Sub() public static méthode

public static Sub ( this a, Vector b ) : System.Point
a this
b Vector
Résultat System.Point

Sub() public static méthode

public static Sub ( this a, System.Point b ) : Vector
a this
b System.Point
Résultat Vector

Sub() public static méthode

public static Sub ( this a, Vector b ) : Vector
a this
b Vector
Résultat Vector

Sub() public static méthode

public static Sub ( this a, Point3 b ) : System.Vector3
a this
b Point3
Résultat System.Vector3

Sub() public static méthode

public static Sub ( this a, System.Vector3 b ) : System.Vector3
a this
b System.Vector3
Résultat System.Vector3

Vector() public static méthode

Returns seg.B - seg.A.
public static Vector ( this seg ) : Vector
seg this
Résultat Vector