geometry.Point()¶
-
class
feign.geometry.Point(x, y)¶ A class used to represent a Point.
- Parameters
x (float) – x coordinate of Point in cm
y (float) – y coordinate of Point in cm
-
x¶ x coordinate of Point in cm
- Type
float
-
y¶ y coordinate of Point in cm
- Type
float
-
distance(other)¶ The function calculates the distance of two Point objects.
- Parameters
other (Point()) – the Point to which the distance is calculated
- Returns
distance of two points
- Return type
float
-
inBetween(p1, p2)¶ The function to assess whether a Point() is on the same line and in between two other Point() objects.
- Parameters
p1,p2 (Point()) – Points for which the test point is checked whether is placed in between.
- Returns
True if the point is between p1 and p2, False otherwise
- Return type
bool
Examples
>>> Point(2,2).inBetween(Point(1,1),Point(4,4)) True >>> Point(-2.3,4.3).inBetween(Point(0,3),Point(5,0)) False
-
isEqual(other)¶ The function to assess whether two Point() objects are the same.
- Parameters
other (Point()) – point with which the equality is checked.
- Returns
True if the points are equal, False otherwise
- Return type
bool
Examples
>>> p=Point(3,3) >>> q=Point(3,3) >>> p.isEqual(q) True >>> a=Point(3,4) >>> p.isEqual(a) False