C# Class HandInput.Util.GeometryUtil

Afficher le fichier Open project: ushadow/handinput

Méthodes publiques

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

Method Details

Angle() public static méthode

Angle between two vectors in radians.
public static Angle ( System.Windows v1, System.Windows v2 ) : float
v1 System.Windows
v2 System.Windows
Résultat float

BetweenX() public static méthode

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

Center() public static méthode

public static Center ( this rect ) : Point
rect this
Résultat System.Windows.Point

ClosestPointToLine() public static méthode

public static ClosestPointToLine ( PointF a, PointF b, PointF p ) : PointF
a System.Drawing.PointF
b System.Drawing.PointF
p System.Drawing.PointF
Résultat System.Drawing.PointF

CrossProduct() public static méthode

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

Distance() public static méthode

Returns distance between p1 and p2.
public static Distance ( Point p1, Point p2 ) : double
p1 Point
p2 Point
Résultat double

Distance() public static méthode

Returns distance between p1 and p2.
public static Distance ( PointF p1, PointF p2 ) : double
p1 System.Drawing.PointF
p2 System.Drawing.PointF
Résultat double

Distance2() public static méthode

public static Distance2 ( double x1, double y1, double x2, double y2 ) : double
x1 double
y1 double
x2 double
y2 double
Résultat double

Distance2() public static méthode

Squared Euclidean distance of two 2D points.
public static Distance2 ( Point p1, Point p2 ) : float
p1 Point Point 1.
p2 Point Point 2.
Résultat float

Distance2() public static méthode

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

DotProduct() public static méthode

public static DotProduct ( System.Windows v1, System.Windows v2 ) : float
v1 System.Windows
v2 System.Windows
Résultat float

EllipseAxes() public static méthode

Returns the end points of the major and minor axes of an ellipse.
public static EllipseAxes ( MCvBox2D ellipse ) : System.Drawing.PointF[]
ellipse MCvBox2D
Résultat System.Drawing.PointF[]

Extend() public static méthode

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

GradientInDegree() public static méthode

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

IsAngleClockwise() public static méthode

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

IsAngleClockwise() public static méthode

public static IsAngleClockwise ( System.Windows v1, System.Windows v2 ) : bool
v1 System.Windows
v2 System.Windows
Résultat bool

LineIntersection() public static méthode

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

LinePointDistance() public static méthode

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

LineSegPointDistance() public static méthode

Line segement (a, b) to point p distance.
public static LineSegPointDistance ( Point a, Point b, Point p ) : double
a Point
b Point
p Point
Résultat double

Midpoint() public static méthode

public static Midpoint ( DepthImagePoint p1, DepthImagePoint p2 ) : DepthImagePoint
p1 DepthImagePoint
p2 DepthImagePoint
Résultat DepthImagePoint

Midpoint() public static méthode

public static Midpoint ( Point p1, Point p2 ) : Point
p1 Point
p2 Point
Résultat Point

Midpoint() public static méthode

public static Midpoint ( PointF p1, PointF p2 ) : PointF
p1 System.Drawing.PointF
p2 System.Drawing.PointF
Résultat System.Drawing.PointF

Offset() public static méthode

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

Offset() public static méthode

public static Offset ( PointF p1, System.Windows dir, float len ) : PointF
p1 System.Drawing.PointF
dir System.Windows
len float
Résultat System.Drawing.PointF

Perp() public static méthode

Returns a new vector which is perpendicular to v.
public static Perp ( System.Windows v ) : System.Windows.Vector
v System.Windows The original vector.
Résultat System.Windows.Vector

ProjectionDistance() public static méthode

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

Rotate() public static méthode

public static Rotate ( PointF p, PointF pivot, double theta ) : PointF
p System.Drawing.PointF
pivot System.Drawing.PointF
theta double
Résultat System.Drawing.PointF

SegmentsIntersect() public static méthode

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

SegmentsIntersect() public static méthode

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

Sign() public static méthode

public static Sign ( double n ) : int
n double
Résultat int

Slope() public static méthode

public static Slope ( Point p1, Point p2 ) : double
p1 Point
p2 Point
Résultat double

Vector() public static méthode

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