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
rotate(alpha)

The function to rotate a Point around the origin with alpha (deg)

Parameters

alpha (float) – Rotation angle (in degrees)

Returns

Point with rotated coordinates

Return type

Point()

Examples

>>> Point(10,0).rotate(90)
Point(0.000, 10.000)
>>> Point(10,0).rotate(45)
Point(7.071, 7.071)
translate(xt, yt)

The function to translate a Point

Parameters
  • xt (float) – translation along x direction

  • yt (float) – translation along y direction

Returns

Point with translated coordinates

Return type

Point()

Examples

>>> Point(10,0).translate(5,3)
Point(15.000, 3.000)