earwax.point module¶
Provides the Point class.
-
class
earwax.point.Point(x: T, y: T, z: T)¶ Bases:
typing.GenericA point in 3d space.
-
angle_between(other: earwax.point.Point) → float¶ Return the angle between two points.
Parameters: other – The other point to get the angle to.
-
coordinates¶ Return
self.x,self.y, andself.zas a tuple.
-
copy() → earwax.point.Point[~T][T]¶ Copy this instance.
Returns a
Pointinstance with duplicatexandyvalues.
-
directions_to(other: earwax.point.Point) → earwax.point.PointDirections¶ Return the direction between this point and
other.Parameters: other – The point to get directions to.
-
distance_between(other: earwax.point.Point) → float¶ Return the distance between two points.
Parameters: other – The point to measure the distance to.
-
floor() → earwax.point.Point[int][int]¶ Return a version of this object with both coordinates floored.
-
in_direction(angle: float, distance: float = 1.0) → earwax.point.Point[float][float]¶ Return the coordinates in the given direction.
Parameters: - angle – The direction of travel.
- distance – The distance to travel.
-
classmethod
origin() → earwax.point.Point[int][int]¶ Return
Point(0, 0, 0).
-
-
class
earwax.point.PointDirections¶ Bases:
enum.EnumPoint directions enumeration.
Most of the possible directions between two
Pointinstances.There are no vertical directions defined, although they would be easy to include.
-
east= 3¶
-
here= 0¶
-
north= 1¶
-
northeast= 2¶
-
northwest= 8¶
-
south= 5¶
-
southeast= 4¶
-
southwest= 6¶
-
west= 7¶
-