Skip to content

Point (inherits from NamedTuple)

Description

Represents a point in the Jubilee 3D coordinate system. A lightweight immutable object holding x, y, and z coordinates. Provides basic arithmetic operations like addition, subtraction, scalar multiplication, and absolute value computation.

Constructor

python
Point(x: float = 0.0, y: float = 0.0, z: float = 0.0)

Initializes a Point at the given x, y, z coordinates.

ParameterTypeDescription
xfloatX-coordinate (default 0.0).
yfloatY-coordinate (default 0.0).
zfloatZ-coordinate (default 0.0).

Properties

(No additional explicit properties — x, y, and z are public fields.)

Methods

MethodReturnsDescription
add(other: Point)PointReturns a new Point by adding two points coordinate-wise.
substract(other: Point)PointReturns a new Point by subtracting two points coordinate-wise.
multiply(other: Union[int, float])PointReturns a new Point scaled by a scalar multiplier.
absolute()PointReturns a new Point with absolute coordinate values.
__repr__()strReturns a human-readable string representation of the point coordinates.

Short Example

python
# Create two points
p1 = Point(x=10, y=5, z=0)
p2 = Point(x=3, y=7, z=1)

# Add points
p3 = p1.add(p2)  # Point(x=13, y=12, z=1)

# Subtract points
p4 = p1.substract(p2)  # Point(x=7, y=-2, z=-1)

# Scale point
p5 = p1.multiply(2)  # Point(x=20, y=10, z=0)

# Absolute value
p6 = p4.absolute()  # Point(x=7, y=2, z=1)

print(p3)

Important Notes

  • Point is immutable: operations return new Point objects instead of modifying existing ones.
  • add() and substract() require the other object to also be a Point.
  • multiply() only accepts scalar values (int or float).
  • Naming follows conventions adapted from the Opentrons API for compatibility and readability.
  • Although spelled substract() in code (rather than subtract()), it operates correctly (be aware during usage).

Pre-release documentation · Internal research use only · Not authorized for redistribution.