Class Reference point

Stores a single point. More...

Member

point( )
point( point p )
point(int x,int y)
double distanceTo(point p2)
double distanceToLine(point p1, point p2)
double distanceToLineAbs(point p1, point p2)
double length()
void set(int x, int y)
void setX(int x)
void setY(int y)
int x()
int y()

Detailed Description

This class stored a single point. As all coordinates it is store as an integer with a resolution of 32 bit. The physical coordinates can be calculated by a multiplication with the databaseunits ([[MacroClassDrawingField|class drawingField]])

Example:

 point p;
 p.set(10000,10000);
 int x=p.x();

Member Function Documentation


point::point( )

creates a point.


point::point( point p )

creates a point containing a copy of p


point::point(int x,int y)

constructs a point with coordinates x and y.


double point::distanceTo(point p2)

Returns: the distance to the p2


double point::distanceToLine(point p1, point p2)

Returns: the shortest distance to the line p1 to p2. The value is negative it the point is left of the line from p1 to p2.


double point::distanceToLineAbs(point p1, point p2)

Returns: the shortest distance to the line p1 to p2. The value is always positive or 0.


double point::length()

Returns: the distance to the origin


void point::set(int x, int y)

Set the x and y coordinates.


void point::setX(int x)

Set the x coordinate.


void point::setY(int y)

Set the y coordinate.


int point::x()

Returns: x-coordinate of the point


int point::y()

Returns: y-coordinate of the point