Point2D¶
python_motion_planning.utils.environment.point2d.Point2D
¶
Bases: object
Class for searching and manipulating 2-dimensional points.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
float
|
x-coordinate of the 2d point |
required |
y
|
float
|
y-coordinate of the 2d point |
required |
eps
|
float
|
tolerance for float comparison |
1e-06
|
Examples:
Python Console Session
>>> from python_motion_planning import Point2D
>>> p1 = Point2D(1, 2)
>>> p2 = Point2D(3, 4)
...
>>> p1
>>> Point2D(1, 2)
...
>>> p1 + p2
>>> Point2D(4, 6)
...
>>> p1 - p2
>>> Point2D(-2, -2)
...
>>> p1 == p2
>>> False
...
>>> p1!= p2
>>> True
...
>>> p1.dist(p2)
>>> 2.8284271247461903
...
>>> p1.angle(p2)
>>> 0.7853981633974483