C# Класс HandInput.Util.GeometryUtil

Показать файл Открыть проект

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

Метод Описание
Angle ( System.Windows v1, System.Windows v2 ) : float

Angle between two vectors in radians.

BetweenX ( Point p, Point p1, Point p2 ) : bool

Returns true iff p lies somewhere between p1 and p2 on x-coordinate

Center ( this rect ) : Point
ClosestPointToLine ( PointF a, PointF b, PointF p ) : PointF
CrossProduct ( System.Windows v1, System.Windows v2 ) : float

Returns the scalar value of the cross product of two vectors.

Distance ( Point p1, Point p2 ) : double

Returns distance between p1 and p2.

Distance ( PointF p1, PointF p2 ) : double

Returns distance between p1 and p2.

Distance2 ( double x1, double y1, double x2, double y2 ) : double
Distance2 ( Point p1, Point p2 ) : float

Squared Euclidean distance of two 2D points.

Distance2 ( PointF p1, PointF p2 ) : float

Squared Euclidean distance of two 2D points.

DotProduct ( System.Windows v1, System.Windows v2 ) : float
EllipseAxes ( MCvBox2D ellipse ) : System.Drawing.PointF[]

Returns the end points of the major and minor axes of an ellipse.

Extend ( PointF p1, PointF p2, float extension ) : PointF

Extends segment (p1, p2) by certain length. The direction of extension is from p1 to p2. If extension is negative, it is equivalent to shortening the segment. The length of the segment cannot be zero.

GradientInDegree ( Point p1, Point p2 ) : float

Returns the angle in degree of the gradient of the line defined by two points.

IsAngleClockwise ( PointF a, PointF b, PointF c ) : bool

Returns true if the angle from vector bc to vector ba is clockwise.

IsAngleClockwise ( System.Windows v1, System.Windows v2 ) : bool
LineIntersection ( PointF a, PointF b, PointF c, PointF d ) : PointF

Point of intersection between line ab and line cd.

LinePointDistance ( PointF p1, PointF p2, PointF p ) : float

Calculates the signed perpendicular distance from a point to a line. Point on the right side of the vector (P1 -> P2) will be NEGATIVE.

LineSegPointDistance ( Point a, Point b, Point p ) : double

Line segement (a, b) to point p distance.

Midpoint ( DepthImagePoint p1, DepthImagePoint p2 ) : DepthImagePoint
Midpoint ( Point p1, Point p2 ) : Point
Midpoint ( PointF p1, PointF p2 ) : PointF
Offset ( Point p1, System.Windows dir, float len ) : Point

Offsets a point in a particular direction by certian length.

Offset ( PointF p1, System.Windows dir, float len ) : PointF
Perp ( System.Windows v ) : System.Windows.Vector

Returns a new vector which is perpendicular to v.

ProjectionDistance ( PointF a, PointF b, PointF p ) : float

Signed length of projection of (a->p) to vector (a->b).

Rotate ( PointF p, PointF pivot, double theta ) : PointF
SegmentsIntersect ( Point a1, Point a2, Point b1, Point b2 ) : bool

Returns true if segment (a1, a2) intersects with segment (b1, b2) including end points.

SegmentsIntersect ( PointF a1, PointF a2, PointF b1, PointF b2 ) : bool
Sign ( double n ) : int
Slope ( Point p1, Point p2 ) : double
Vector ( PointF a, PointF b ) : System.Windows.Vector

Returns a new Vector from a to b.

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

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

Angle between two vectors in radians.
public static Angle ( System.Windows v1, System.Windows v2 ) : float
v1 System.Windows
v2 System.Windows
Результат float

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

Returns true iff p lies somewhere between p1 and p2 on x-coordinate
public static BetweenX ( Point p, Point p1, Point p2 ) : bool
p Point
p1 Point
p2 Point
Результат bool

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

public static Center ( this rect ) : Point
rect this
Результат System.Windows.Point

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

public static ClosestPointToLine ( PointF a, PointF b, PointF p ) : PointF
a System.Drawing.PointF
b System.Drawing.PointF
p System.Drawing.PointF
Результат System.Drawing.PointF

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

Returns the scalar value of the cross product of two vectors.
public static CrossProduct ( System.Windows v1, System.Windows v2 ) : float
v1 System.Windows
v2 System.Windows
Результат float

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

Returns distance between p1 and p2.
public static Distance ( Point p1, Point p2 ) : double
p1 Point
p2 Point
Результат double

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

Returns distance between p1 and p2.
public static Distance ( PointF p1, PointF p2 ) : double
p1 System.Drawing.PointF
p2 System.Drawing.PointF
Результат double

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

public static Distance2 ( double x1, double y1, double x2, double y2 ) : double
x1 double
y1 double
x2 double
y2 double
Результат double

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

Squared Euclidean distance of two 2D points.
public static Distance2 ( Point p1, Point p2 ) : float
p1 Point Point 1.
p2 Point Point 2.
Результат float

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

Squared Euclidean distance of two 2D points.
public static Distance2 ( PointF p1, PointF p2 ) : float
p1 System.Drawing.PointF Point 1.
p2 System.Drawing.PointF Point 2.
Результат float

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

public static DotProduct ( System.Windows v1, System.Windows v2 ) : float
v1 System.Windows
v2 System.Windows
Результат float

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

Returns the end points of the major and minor axes of an ellipse.
public static EllipseAxes ( MCvBox2D ellipse ) : System.Drawing.PointF[]
ellipse MCvBox2D
Результат System.Drawing.PointF[]

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

Extends segment (p1, p2) by certain length. The direction of extension is from p1 to p2. If extension is negative, it is equivalent to shortening the segment. The length of the segment cannot be zero.
public static Extend ( PointF p1, PointF p2, float extension ) : PointF
p1 System.Drawing.PointF One end of the segment.
p2 System.Drawing.PointF The other end of the segment.
extension float The length of the extension.
Результат System.Drawing.PointF

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

Returns the angle in degree of the gradient of the line defined by two points.
public static GradientInDegree ( Point p1, Point p2 ) : float
p1 Point
p2 Point
Результат float

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

Returns true if the angle from vector bc to vector ba is clockwise.
public static IsAngleClockwise ( PointF a, PointF b, PointF c ) : bool
a System.Drawing.PointF
b System.Drawing.PointF
c System.Drawing.PointF
Результат bool

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

public static IsAngleClockwise ( System.Windows v1, System.Windows v2 ) : bool
v1 System.Windows
v2 System.Windows
Результат bool

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

Point of intersection between line ab and line cd.
public static LineIntersection ( PointF a, PointF b, PointF c, PointF d ) : PointF
a System.Drawing.PointF
b System.Drawing.PointF
c System.Drawing.PointF
d System.Drawing.PointF
Результат System.Drawing.PointF

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

Calculates the signed perpendicular distance from a point to a line. Point on the right side of the vector (P1 -> P2) will be NEGATIVE.
public static LinePointDistance ( PointF p1, PointF p2, PointF p ) : float
p1 System.Drawing.PointF One end of the line.
p2 System.Drawing.PointF The other end of the line.
p System.Drawing.PointF
Результат float

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

Line segement (a, b) to point p distance.
public static LineSegPointDistance ( Point a, Point b, Point p ) : double
a Point
b Point
p Point
Результат double

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

public static Midpoint ( DepthImagePoint p1, DepthImagePoint p2 ) : DepthImagePoint
p1 DepthImagePoint
p2 DepthImagePoint
Результат DepthImagePoint

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

public static Midpoint ( Point p1, Point p2 ) : Point
p1 Point
p2 Point
Результат Point

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

public static Midpoint ( PointF p1, PointF p2 ) : PointF
p1 System.Drawing.PointF
p2 System.Drawing.PointF
Результат System.Drawing.PointF

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

Offsets a point in a particular direction by certian length.
public static Offset ( Point p1, System.Windows dir, float len ) : Point
p1 Point
dir System.Windows
len float
Результат Point

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

public static Offset ( PointF p1, System.Windows dir, float len ) : PointF
p1 System.Drawing.PointF
dir System.Windows
len float
Результат System.Drawing.PointF

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

Returns a new vector which is perpendicular to v.
public static Perp ( System.Windows v ) : System.Windows.Vector
v System.Windows The original vector.
Результат System.Windows.Vector

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

Signed length of projection of (a->p) to vector (a->b).
public static ProjectionDistance ( PointF a, PointF b, PointF p ) : float
a System.Drawing.PointF
b System.Drawing.PointF
p System.Drawing.PointF
Результат float

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

public static Rotate ( PointF p, PointF pivot, double theta ) : PointF
p System.Drawing.PointF
pivot System.Drawing.PointF
theta double
Результат System.Drawing.PointF

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

Returns true if segment (a1, a2) intersects with segment (b1, b2) including end points.
public static SegmentsIntersect ( Point a1, Point a2, Point b1, Point b2 ) : bool
a1 Point
a2 Point
b1 Point
b2 Point
Результат bool

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

public static SegmentsIntersect ( PointF a1, PointF a2, PointF b1, PointF b2 ) : bool
a1 System.Drawing.PointF
a2 System.Drawing.PointF
b1 System.Drawing.PointF
b2 System.Drawing.PointF
Результат bool

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

public static Sign ( double n ) : int
n double
Результат int

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

public static Slope ( Point p1, Point p2 ) : double
p1 Point
p2 Point
Результат double

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

Returns a new Vector from a to b.
public static Vector ( PointF a, PointF b ) : System.Windows.Vector
a System.Drawing.PointF
b System.Drawing.PointF
Результат System.Windows.Vector