C# 클래스 HandInput.Util.GeometryUtil

파일 보기 프로젝트 열기: ushadow/handinput

공개 메소드들

메소드 설명
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