UNITS
CLASSES, INTERFACES, OBJECTS
TYPES
VARIABLES
CONSTANTS
FUNCTIONS, PROCEDURES
IDENTIFIERS

Unit UXYPoint

Description

The Unit delivers the modell for a 2 dimensional point object as well as some service routines to compare and transform the object geomtrically.

Constants

NameDescription
CXYPoint String formatter for the data in interpreting modus.
CXYPointTk String constant for the token in interpreting modus.
CXYPointTkn String formatter for the data and token in interpreting modus.

Variables

NameDescription
DummyXYPoint  

Types

NameDescription
TAffinTransform Container for the affine transformation
TXYVector Synonym for TXYPoint

Functions and procedures

Overview

Function ExXYPointEqual(Times: TDouble; P1, P2: TXYPoint): TBoolean;
Function IntersectPoints(P1,P2,Q1,Q2:TXYPoint;Var IsParalell:TBoolean):TXYPoint;
Function IsInside(aPoint: TXYPoint; aMin, aMax: TXYPoint): TBoolean;
Function OverlapRect(Rect1Min, Rect1Max, Rect2Min, Rect2Max: TXYPoint): TBoolean;
Function OverlapRectCoord(Rect1MinX, Rect1MinY, Rect1MaxX, Rect1MaxY, Rect2MinX, Rect2MinY, Rect2MaxX, Rect2MaxY: TDouble): TBoolean;
Function ReadPPoint(S1, S2: Char; Var S: String; P: TXYPoint): TBoolean;
Function ReadPPointDeg(S1, S2: Char; Var S: String; P: TXYPoint): TBoolean;
Function SizeRect(aMin, aMax: TXYPoint): TDouble;
Procedure SortRect(aMin, aMax: TXYPoint);
Procedure SwapXYPoint(P1, P2: TXYPoint);
Function TriXYAngle(PBegin, PMiddle, PEnd: TXYPoint): TDouble;
Function TriXYArea(PBegin, PMiddle, PEnd: TXYPoint): TDouble;
Function TriXYCos(PBegin, PMiddle, PEnd: TXYPoint): TDouble;
Function XYLength(A, B: TXYPoint): TDouble;
Function XYLengthCoord(X1, Y1, X2, Y2: TDouble): TDouble;
Function XYPointEqual(P1, P2: TXYPoint): TBoolean;
Procedure XYPointInitMinMax(aMin, aMax: TXYPoint);
Procedure XYPointMinMax(aPoint: TXYPoint; aMin, aMax: TXYPoint);
Function XYSQRLength(A, B: TXYPoint): TDouble;

Description

Function ExXYPointEqual(Times: TDouble; P1, P2: TXYPoint): TBoolean;

Comparision of two points with tolerance. ExXYPointEqual:=((Round(P1.X*Times)=Round(P2.X*Times)) AND(Round(P1.Y*Times)=Round(P2.Y*Times)));

Function IntersectPoints(P1,P2,Q1,Q2:TXYPoint;Var IsParalell:TBoolean):TXYPoint;

Intersecting Segments P1P2 and Q1Q2. Result is NOT NIL if exists and if it is paralell IsPararlell is TRUE.

Function IsInside(aPoint: TXYPoint; aMin, aMax: TXYPoint): TBoolean;

Query the location of aPoint in the rectangle defined by (aMin,aMax). IF aPoint is inside the function gives back TRUE.

Function OverlapRect(Rect1Min, Rect1Max, Rect2Min, Rect2Max: TXYPoint): TBoolean;

Query the overlapping of the rectangels Rect1 and Rect 2 defined by Rect1Min,Rect1aMax and Rect2Min,Rect2Max. If they are not disjucnt the function gives back TRUE

Function OverlapRectCoord(Rect1MinX, Rect1MinY, Rect1MaxX, Rect1MaxY, Rect2MinX, Rect2MinY, Rect2MaxX, Rect2MaxY: TDouble): TBoolean;

Query the overlapping of the Rectangels Rect1 and Rect 2 defined by Rect1MinX,Rect1MinY,Rect1MaxX,Rect1MaxY and Rect2MinX,Rect2MinY,Rect2MaxX,Rect2MaxY. If they are not disjucnt thefunction gives back TRUE

Function ReadPPoint(S1, S2: Char; Var S: String; P: TXYPoint): TBoolean;

Reading routine by given separators for plain coordinates. Formatting XXXXXS1YYYYYS2. If somting is wrong the function will be false. Please call the string GetError from Unit UStringutils.

Function ReadPPointDeg(S1, S2: Char; Var S: String; P: TXYPoint): TBoolean;

Reading routine by given separators for decdeg coordinates. Formatting XXXXXS1YYYYYS2. If somting is wrong the function will be false. Please call the string GetError from Unit UStringutils.

Function SizeRect(aMin, aMax: TXYPoint): TDouble;

Size of the rectangle defined by aMin,aMax.

Procedure SortRect(aMin, aMax: TXYPoint);

Sorting of the extremal points of the rectangle defined by aMin,aMax.

Procedure SwapXYPoint(P1, P2: TXYPoint);

Coordinat swapping from P1 to P2 and also in opposit direction.

Function TriXYAngle(PBegin, PMiddle, PEnd: TXYPoint): TDouble;

Angle between the three points in deg that means 0-360°. If the area of the inclosed triangle is zero the the functio gives back 1E38.

Function TriXYArea(PBegin, PMiddle, PEnd: TXYPoint): TDouble;

Area of the inclosed triangle with following orientation. Positiv areal values cw orientation. Negativ areal values ccw orientation.

Function TriXYCos(PBegin, PMiddle, PEnd: TXYPoint): TDouble;

Cosine between the three points. You can not see the orientation (hafplane). If the area of the inclosed triangle is zero the the functio gives back 1E38.

Function XYLength(A, B: TXYPoint): TDouble;

Euclidian distance of 2 points

Function XYLengthCoord(X1, Y1, X2, Y2: TDouble): TDouble;

Euclidian distance coordinate wise of 2 points

Function XYPointEqual(P1, P2: TXYPoint): TBoolean;

Comparision of two points.

Procedure XYPointInitMinMax(aMin, aMax: TXYPoint);

Initialization of the mini-/maximal extention by opposit quatities .

Procedure XYPointMinMax(aPoint: TXYPoint; aMin, aMax: TXYPoint);

Update the mini-/maximal Extention with the values of aPoint and stor it in aMin,aMax.

Function XYSQRLength(A, B: TXYPoint): TDouble;

Square of euclidian distance of 2 points

Classes, interfaces and objects

NameDescription
Class TXYPoint Definition of the 2 dimensionsl point object with double prec.

Author

Alexander Weidauer alex.weidauer@huckfinn.de

Created

February 2002

Last modification

February 2002


Generated by pasdoc 0.6.20 on Mon 18 Feb 2002 20:55:35