unitelabs.labware.math

Packages

Attributes

  • Name
    Number
    Type
    Value

    = typing.Union[str, int, float, tuple[int, collections.abc.Sequence[int], int], decimal.Decimal]

    Description

  • Name
    __all__
    Type
    Value

    = [ "Number", "Decimal", "is_number", "parse_number", "DecimalField", "Vector", "place", "place_standardized", "Alignment", "Direction", "mm_to_100um", "to_mm", "ul_to_100nl", "to_ul", "c_to_100c", "to_c", "Shape", "ComplexShape", "Stack", "Cuboid", "Pyramid", "Cylinder", "Cone", "ConicalFrustum", "HalfSphere", "SphericalCap", "SphericalSegment", "PyramidalFrustum" ]

    Description

Functions

  • mm_to_100um(value : Number) -> int

    Convert mm into 0.1mm.

    Parameters

    • Name
      value
      Type
      Number
      Default
      Description

      The number in mm to convert.

    Response

    Type
    int
    Description

    The value with unit 0.1mm.

  • is_number(value : typing.Any) -> bool

    Check whether a value is of numeric type.

    Parameters

    • Name
      value
      Type
      typing.Any
      Default
      Description

      The number to check.

    Response

    Type
    bool
    Description

  • to_mm(value : int) -> decimal.Decimal

    Convert 0.1mm into mm.

    Parameters

    • Name
      value
      Type
      int
      Default
      Description

      The number in 0.1mm to convert.

    Response

    Type
    decimal.Decimal
    Description

    The value with unit mm.

  • parse_number(value : Number) -> decimal.Decimal

    Convert any valid number to a decimal value.

    Parameters

    • Name
      value
      Type
      Number
      Default
      Description

      The number to convert.

    Response

    Type
    decimal.Decimal
    Description

    The decimal value.

  • ul_to_100nl(value : Number) -> int

    Convert µl into 0.1µl.

    Parameters

    • Name
      value
      Type
      Number
      Default
      Description

      The number in µl to convert.

    Response

    Type
    int
    Description

    The value with unit 0.1µl.

  • to_ul(value : Number) -> decimal.Decimal

    Convert 0.1µl into µl.

    Parameters

    • Name
      value
      Type
      Number
      Default
      Description

      The number in 0.1µl to convert.

    Response

    Type
    decimal.Decimal
    Description

    The value with unit µl.

  • place(
      cols : int,
      rows : int,
      offset : typing.Optional[Vector],
      direction,
      justify,
      align,
    ) -> typing.Generator[tuple[Vector, Vector], None, None]

    Calculates the location of rows x cols items around the center of the parent's plane.

    Parameters

    • Name
      cols
      Type
      int
      Default
      Description

      The number of items along the x axis.

    • Name
      rows
      Type
      int
      Default
      Description

      The number of items along the y axis.

    • Name
      item
      Type
      Vector
      Default
      Description

      Each item's dimension.

    • Name
      boundary
      Type
      Vector
      Default
      Description

      The container's dimension.

    • Name
      offset
      Type
      typing.Optional[Vector]
      Default
      = None
      Description

      Optional offset to apply to the item's location.

    • Name
      direction
      Type
      Default
      = COLUMN_ROW
      Description

      Establishes the direction in which items are placed in the container.

    • Name
      justify
      Type
      Default
      = CENTER
      Description

      Defines the alignment along the x-axis.

    • Name
      align
      Type
      Default
      = CENTER
      Description

      Defines the alignment along the y-axis.

    • Name
      stack
      Type
      typing.Literal[START, CENTER, END]
      Default
      = END
      Description

      Defines the alignment along the z-axis.

    Response

    Type
    typing.Generator[tuple[Vector, Vector], None, None]
    Description

    Tuples for each items' location and dimension.

  • c_to_100c(value : Number) -> int

    Convert °C into 0.1°C.

    Parameters

    • Name
      value
      Type
      Number
      Default
      Description

      The number in °C to convert.

    Response

    Type
    int
    Description

    The value with unit 0.1°C.

  • to_c(value : int) -> decimal.Decimal

    Convert 0.1°C into °C.

    Parameters

    • Name
      value
      Type
      int
      Default
      Description

      The number in 0.1°C to convert.

    Response

    Type
    decimal.Decimal
    Description

    The value with unit °C.

  • place_standardized(
      count : typing.Literal[96, 384, 1536],
      boundary_height : typing.Optional[Number],
      item_height : typing.Optional[Number]
    ) -> typing.Generator[tuple[Vector, Vector], None, None]

    Place wells on a plate according to the ANSI / SLAS microplate standard.

    Parameters

    • Name
      count
      Type
      typing.Literal[96, 384, 1536]
      Default
      Description

      The number of items to place on the resource.

    • Name
      boundary_height
      Type
      typing.Optional[Number]
      Default
      = None
      Description

    • Name
      item_height
      Type
      typing.Optional[Number]
      Default
      = None
      Description

    Response

    Type
    typing.Generator[tuple[Vector, Vector], None, None]
    Description

    Tuples for each items' location and dimension.

Classes

  • Decimal

    Decimal number for fast correctly rounded decimal floating point arithmetic.

    Methods

    • __init__(self, default : Number) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        default
        Type
        Number
        Default
        Description

    • __set_name__(self, owner : type[object], name : str) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        owner
        Type
        type[object]
        Default
        Description

      • Name
        name
        Type
        str
        Default
        Description

    • __get__(self, instance : typing.Optional[object], owner : typing.Optional[type[object]]) -> decimal.Decimal

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        instance
        Type
        typing.Optional[object]
        Default
        Description

      • Name
        owner
        Type
        typing.Optional[type[object]]
        Default
        Description

      Response

      Type
      decimal.Decimal
      Description

    • __set__(self, instance : typing.Optional[object], value : Number) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        instance
        Type
        typing.Optional[object]
        Default
        Description

      • Name
        value
        Type
        Number
        Default
        Description

    Attributes

    • Name
      _default_value
      Type
      Value

      = default

      Description

    • Name
      _attr_name
      Type
      Value

      = ''

      Description

  • DecimalField

    Bases
    marshmallow.fields.Field

    Methods

    • _serialize(
        self,
        value : typing.Any,
        attr : typing.Optional[str],
        obj : typing.Any,
        **kwargs
      ) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        value
        Type
        typing.Any
        Default
        Description

      • Name
        attr
        Type
        typing.Optional[str]
        Default
        Description

      • Name
        obj
        Type
        typing.Any
        Default
        Description

      • Name
        **kwargs
        Type
        Default
        = {}
        Description

    • _deserialize(
        self,
        value : typing.Any,
        attr : typing.Optional[str],
        data : typing.Optional[typing.Mapping[str, typing.Any]],
        **kwargs
      ) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        value
        Type
        typing.Any
        Default
        Description

      • Name
        attr
        Type
        typing.Optional[str]
        Default
        Description

      • Name
        data
        Type
        typing.Optional[typing.Mapping[str, typing.Any]]
        Default
        Description

      • Name
        **kwargs
        Type
        Default
        = {}
        Description

  • Alignment

    Defines the alignment and distribution of items along an axis.

    Bases
    enum.Enum

    Attributes

    • Name
      START
      Type
      Value

      = enum.auto()

      Description

      Items are packed toward the start of the direction.

    • Name
      END
      Type
      Value

      = enum.auto()

      Description

      Items are packed toward the end of the direction.

    • Name
      CENTER
      Type
      Value

      = enum.auto()

      Description

      Items are centered along the direction.

    • Name
      SPACE_BETWEEN
      Type
      Value

      = enum.auto()

      Description

      Items are evenly distributed in the direction; first item is on the start line, last item on the end line.

    • Name
      SPACE_AROUND
      Type
      Value

      = enum.auto()

      Description

      Items are evenly distributed in the direction with equal space around them.

    • Name
      SPACE_EVENLY
      Type
      Value

      = enum.auto()

      Description

      Items are distributed so that the spacing between any two items (and the space to the edges) is equal.

  • Direction

    Defines the direction in which items are placed in the container.

    Bases
    enum.Enum

    Attributes

    • Name
      COLUMN_ROW
      Type
      Value

      = enum.auto()

      Description

      Starting at the top left corner, moving from top to bottom, then from left to right.

    • Name
      COLUMN_REVERSE_ROW
      Type
      Value

      = enum.auto()

      Description

      Starting at the bottom left corner, moving from bottom to top, then from left to right.

    • Name
      COLUMN_ROW_REVERSE
      Type
      Value

      = enum.auto()

      Description

      Starting at the top right corner, moving from top to bottom, then from right to left.

    • Name
      COLUMN_REVERSE_ROW_REVERSE
      Type
      Value

      = enum.auto()

      Description

      Starting at the bottom right corner, moving from bottom to top, then from right to left.

    • Name
      ROW_COLUMN
      Type
      Value

      = enum.auto()

      Description

      Starting at the top left corner, moving from left to right, then from top to bottom.

    • Name
      ROW_COLUMN_REVERSE
      Type
      Value

      = enum.auto()

      Description

      Starting at the bottom left corner, moving from left to right, then from bottom to top.

    • Name
      ROW_REVERSE_COLUMN
      Type
      Value

      = enum.auto()

      Description

      Starting at the top right corner, moving from right to left, then from top to bottom.

    • Name
      ROW_REVERSE_COLUMN_REVERSE
      Type
      Value

      = enum.auto()

      Description

      Starting at the bottom right corner, moving from right to left, then from bottom to top.

  • ComplexShape

    A shape with with complex dimensions that can be filled with liquid.

    Decorators
    dataclasses.dataclass

    Methods

    • __init__(self, height : Decimal, factor : Decimal) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        height
        Type
        Decimal
        Default
        Description

      • Name
        factor
        Type
        Decimal
        Default
        Description

    • volume_for_height(self, height : Number) -> decimal.Decimal

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        height
        Type
        Number
        Default
        Description

      Response

      Type
      decimal.Decimal
      Description

    • height_for_volume(self, volume : Number) -> decimal.Decimal

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        volume
        Type
        Number
        Default
        Description

      Response

      Type
      decimal.Decimal
      Description

    • __post_init__(self) -> None

    Attributes

    • Name
      factor
      Type
      Decimal
      Value

      = Decimal()

      Description

    • Name
      max_fitting_volume
      Type
      decimal.Decimal
      Value

      = None

      Description

      The maximum volume that fits into this shape.

    • Name
      height
      Type
      Decimal
      Value

      = Decimal()

      Description

  • Cone

    A solid shape with a circular base shape, that narrows smoothly from the base to a point at a certain height.

    MRO
    Decorators
    dataclasses.dataclass

    Methods

    • __init__(self, height : Decimal, radius : Decimal) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        height
        Type
        Decimal
        Default
        Description

      • Name
        radius
        Type
        Decimal
        Default
        Description

    • __post_init__(self) -> None

    • volume_for_height(self, height) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        height
        Type
        Default
        Description

    • height_for_volume(self, volume) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        volume
        Type
        Default
        Description

    Attributes

    • Name
      radius
      Type
      Decimal
      Value

      = Decimal()

      Description

    • Name
      height
      Type
      Decimal
      Value

      = Decimal()

      Description

    • Name
      max_fitting_volume
      Type
      decimal.Decimal
      Value

      = None

      Description

      The maximum volume that fits into this shape.

  • ConicalFrustum

    A solid shape with 3 faces. A conical frustum is the lower portion or base of a cone that is a result of cutting off the upper portion by a plane parallel to the base of the shape. See: https://math.stackexchange.com/questions/234upper534/relation-between-height-and-volume-of-frustum

    Decorators
    dataclasses.dataclass

    Methods

    • __init__(
        self,
      ) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        height
        Type
        Decimal
        Default
        Description

      • Name
        radius_lower
        Type
        Decimal
        Default
        Description

      • Name
        radius_upper
        Type
        Decimal
        Default
        Description

    • __post_init__(self) -> None

    • volume_for_height(self, height) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        height
        Type
        Default
        Description

    • height_for_volume(self, volume) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        volume
        Type
        Default
        Description

    Attributes

    • Name
      radius_lower
      Type
      Decimal
      Value

      = Decimal()

      Description

    • Name
      radius_upper
      Type
      Decimal
      Value

      = Decimal()

      Description

    • Name
      height
      Type
      Decimal
      Value

      = Decimal()

      Description

    • Name
      max_fitting_volume
      Type
      decimal.Decimal
      Value

      = None

      Description

      The maximum volume that fits into this shape.

  • Cuboid

    A six-faced solid shape with a rectangular base shape and a certain height.

    MRO
    Decorators
    dataclasses.dataclass

    Methods

    • __init__(
        self,
      ) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        height
        Type
        Decimal
        Default
        Description

      • Name
        width
        Type
        Decimal
        Default
        Description

      • Name
        depth
        Type
        Decimal
        Default
        Description

    • __post_init__(self) -> None

    • volume_for_height(self, height) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        height
        Type
        Default
        Description

    • height_for_volume(self, volume) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        volume
        Type
        Default
        Description

    Attributes

    • Name
      width
      Type
      Decimal
      Value

      = Decimal()

      Description

    • Name
      depth
      Type
      Decimal
      Value

      = Decimal()

      Description

    • Name
      height
      Type
      Decimal
      Value

      = Decimal()

      Description

    • Name
      max_fitting_volume
      Type
      decimal.Decimal
      Value

      = None

      Description

      The maximum volume that fits into this shape.

  • Cylinder

    A solid shape with two parallel circular base shapes joined by a curved surface with a certain height.

    MRO
    Decorators
    dataclasses.dataclass

    Methods

    • __init__(self, height : Decimal, radius : Decimal) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        height
        Type
        Decimal
        Default
        Description

      • Name
        radius
        Type
        Decimal
        Default
        Description

    • __post_init__(self) -> None

    • volume_for_height(self, height) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        height
        Type
        Default
        Description

    • height_for_volume(self, volume) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        volume
        Type
        Default
        Description

    Attributes

    • Name
      radius
      Type
      Decimal
      Value

      = Decimal()

      Description

    • Name
      height
      Type
      Decimal
      Value

      = Decimal()

      Description

    • Name
      max_fitting_volume
      Type
      decimal.Decimal
      Value

      = None

      Description

      The maximum volume that fits into this shape.

  • HalfSphere

    A solid shape with a circular base shape, that arcs smoothly down from the base to the lowest point at a certain height (equivalent to the radius of the base shape).

    MRO
    Decorators
    dataclasses.dataclass

    Methods

    • __init__(self, height : Decimal, radius : Decimal) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        height
        Type
        Decimal
        Default
        Description

      • Name
        radius
        Type
        Decimal
        Default
        Description

    • __post_init__(self) -> None

    • volume_for_height(self, height) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        height
        Type
        Default
        Description

    • height_for_volume(self, volume) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        volume
        Type
        Default
        Description

    Attributes

    • Name
      radius
      Type
      Decimal
      Value

      = dataclasses.field(init=False, default=Decimal())

      Description

    • Name
      height
      Type
      Decimal
      Value

      = Decimal()

      Description

    • Name
      max_fitting_volume
      Type
      decimal.Decimal
      Value

      = None

      Description

      The maximum volume that fits into this shape.

  • Pyramid

    A five-faced solid shape with a rectangular base shape and the lateral surfaces as triangles that meet at a common vertex at a certain height.

    MRO
    Decorators
    dataclasses.dataclass

    Methods

    • __init__(
        self,
      ) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        height
        Type
        Decimal
        Default
        Description

      • Name
        width
        Type
        Decimal
        Default
        Description

      • Name
        depth
        Type
        Decimal
        Default
        Description

    • __post_init__(self) -> None

    • volume_for_height(self, height) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        height
        Type
        Default
        Description

    • height_for_volume(self, volume) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        volume
        Type
        Default
        Description

    Attributes

    • Name
      width
      Type
      Decimal
      Value

      = Decimal()

      Description

    • Name
      depth
      Type
      Decimal
      Value

      = Decimal()

      Description

    • Name
      height
      Type
      Decimal
      Value

      = Decimal()

      Description

    • Name
      max_fitting_volume
      Type
      decimal.Decimal
      Value

      = None

      Description

      The maximum volume that fits into this shape.

  • PyramidalFrustum

    A solid shape with 6 faces. A pyramidal frustum is the lower portion or base of a pyramid that is a result of cutting off the upper portion by a plane parallel to the base of the shape. If the width and length of the lower and the upper plane are equal respectively, the pyramidal frustum is called a square frustum.

    Decorators
    dataclasses.dataclass

    Methods

    • __init__(
        self,
      ) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        height
        Type
        Decimal
        Default
        Description

      • Name
        width_lower
        Type
        Decimal
        Default
        Description

      • Name
        depth_lower
        Type
        Decimal
        Default
        Description

      • Name
        width_upper
        Type
        Decimal
        Default
        Description

      • Name
        depth_upper
        Type
        Decimal
        Default
        Description

    • __post_init__(self) -> None

    • volume_for_height(self, height) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        height
        Type
        Default
        Description

    • height_for_volume(self, volume) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        volume
        Type
        Default
        Description

    Attributes

    • Name
      width_lower
      Type
      Decimal
      Value

      = Decimal()

      Description

    • Name
      depth_lower
      Type
      Decimal
      Value

      = Decimal()

      Description

    • Name
      width_upper
      Type
      Decimal
      Value

      = Decimal()

      Description

    • Name
      depth_upper
      Type
      Decimal
      Value

      = Decimal()

      Description

    • Name
      height
      Type
      Decimal
      Value

      = Decimal()

      Description

    • Name
      max_fitting_volume
      Type
      decimal.Decimal
      Value

      = None

      Description

      The maximum volume that fits into this shape.

  • Shape

    A 3D solid shape with a certain height that can be filled with liquid.

    Decorators
    dataclasses.dataclass

    Methods

    • __init__(self, height : Decimal) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        height
        Type
        Decimal
        Default
        Description

    • __post_init__(self) -> None

    • volume_for_height(self, height : Number) -> decimal.Decimal

      Calculates the volume within this shape for a particular height.

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        height
        Type
        Number
        Default
        Description

        The height within this shape.

      Response

      Type
      decimal.Decimal
      Description

      The inner shape's volume in µl with the given height.

    • height_for_volume(self, volume : Number) -> decimal.Decimal

      Calculates the height within this shape for a particular volume.

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        volume
        Type
        Number
        Default
        Description

        The volume in this shape.

      Response

      Type
      decimal.Decimal
      Description

      The inner shape's height in mm with the given volume.

    Attributes

    • Name
      height
      Type
      Decimal
      Value

      = Decimal()

      Description

    • Name
      max_fitting_volume
      Type
      decimal.Decimal
      Value

      = None

      Description

      The maximum volume that fits into this shape.

  • SphericalCap

    A solid shape in form of the cap of a sphere. If the height is equal to the radius of the sphere, the spherical cap turn into a half sphere.

    Decorators
    dataclasses.dataclass

    Methods

    • __init__(self, height : Decimal, radius : Decimal) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        height
        Type
        Decimal
        Default
        Description

      • Name
        radius
        Type
        Decimal
        Default
        Description

    • __post_init__(self) -> None

    • volume_for_height(self, height) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        height
        Type
        Default
        Description

    • height_for_volume(self, volume) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        volume
        Type
        Default
        Description

    Attributes

    • Name
      radius
      Type
      Decimal
      Value

      = Decimal()

      Description

    • Name
      height
      Type
      Decimal
      Value

      = Decimal()

      Description

    • Name
      max_fitting_volume
      Type
      decimal.Decimal
      Value

      = None

      Description

      The maximum volume that fits into this shape.

  • SphericalSegment

    a spherical segment is the solid defined by cutting a sphere or a ball with a pair of parallel planes. It can be thought of as a spherical cap with the top truncated, and so it corresponds to a spherical frustum.

    Decorators
    dataclasses.dataclass

    Methods

    • __init__(
        self,
      ) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        height
        Type
        Decimal
        Default
        Description

      • Name
        radius_lower
        Type
        Decimal
        Default
        Description

      • Name
        radius_upper
        Type
        Decimal
        Default
        Description

    • __post_init__(self) -> None

    • volume_for_height(self, height) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        height
        Type
        Default
        Description

    • height_for_volume(self, volume) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        volume
        Type
        Default
        Description

    Attributes

    • Name
      radius_lower
      Type
      Decimal
      Value

      = Decimal()

      Description

    • Name
      radius_upper
      Type
      Decimal
      Value

      = Decimal()

      Description

    • Name
      height
      Type
      Decimal
      Value

      = Decimal()

      Description

    • Name
      max_fitting_volume
      Type
      decimal.Decimal
      Value

      = None

      Description

      The maximum volume that fits into this shape.

  • Stack

    Composition of multiple solid shapes ordered from top to bottom.

    MRO
    Decorators
    dataclasses.dataclass

    Methods

    • __init__(self, height : Decimal, sections : list[Shape]) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        height
        Type
        Decimal
        Default
        Description

      • Name
        sections
        Type
        list[Shape]
        Default
        Description

    • __post_init__(self) -> None

    • volume_for_height(self, height) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        height
        Type
        Default
        Description

    • height_for_volume(self, volume) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        volume
        Type
        Default
        Description

    Attributes

    • Name
      sections
      Type
      list[Shape]
      Value

      = dataclasses.field(default_factory=list)

      Description

    • Name
      height
      Type
      Decimal
      Value

      = dataclasses.field(init=False, default=Decimal())

      Description

    • Name
      max_fitting_volume
      Type
      decimal.Decimal
      Value

      = None

      Description

      The maximum volume that fits into this shape.

  • Vector

    Represents coordinates in a Cartesian coordinate system. In the context of robotics, imagine to face the machine's front: the system's origin is the bottom left corner next to you. ``` z ↑ y | ↗ └ - → x ```

    Decorators
    dataclasses.dataclass

    Methods

    • __init__(self, x : Decimal, y : Decimal, z : Decimal) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        x
        Type
        Decimal
        Default
        Description

        The x coordinate.

      • Name
        y
        Type
        Decimal
        Default
        Description

        The y coordinate.

      • Name
        z
        Type
        Decimal
        Default
        Description

        The z coordinate.

    • copy(self) -> Vector

      Returns a new Vector that is a copy of the current Vector.

      Response

      Type
      Vector
      Description

      A new Vector with the same x, y, and z values as the original Vector.

    • update(self, x : typing.Optional[Number], y : typing.Optional[Number], z : typing.Optional[Number]) -> Vector

      Returns a new Vector with the provided coordinate updates.

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        x
        Type
        typing.Optional[Number]
        Default
        = None
        Description

      • Name
        y
        Type
        typing.Optional[Number]
        Default
        = None
        Description

      • Name
        z
        Type
        typing.Optional[Number]
        Default
        = None
        Description

      Response

      Type
      Vector
      Description

      A new Vector with the updated or same x, y, and z values as the

    • __add__(self, other : typing.Union[Number, Vector]) -> Vector

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        other
        Type
        typing.Union[Number, Vector]
        Default
        Description

      Response

      Type
      Vector
      Description

    • __radd__(self, other : typing.Union[Number, Vector]) -> Vector

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        other
        Type
        typing.Union[Number, Vector]
        Default
        Description

      Response

      Type
      Vector
      Description

    • __iadd__(self, other : typing.Union[Number, Vector]) -> Vector

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        other
        Type
        typing.Union[Number, Vector]
        Default
        Description

      Response

      Type
      Vector
      Description

    • __sub__(self, other : typing.Union[Number, Vector]) -> Vector

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        other
        Type
        typing.Union[Number, Vector]
        Default
        Description

      Response

      Type
      Vector
      Description

    • __rsub__(self, other : typing.Union[Number, Vector]) -> Vector

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        other
        Type
        typing.Union[Number, Vector]
        Default
        Description

      Response

      Type
      Vector
      Description

    • __isub__(self, other : typing.Union[Number, Vector]) -> Vector

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        other
        Type
        typing.Union[Number, Vector]
        Default
        Description

      Response

      Type
      Vector
      Description

    • __mul__(self, other : typing.Union[Number, Vector]) -> Vector

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        other
        Type
        typing.Union[Number, Vector]
        Default
        Description

      Response

      Type
      Vector
      Description

    • __rmul__(self, other : typing.Union[Number, Vector]) -> Vector

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        other
        Type
        typing.Union[Number, Vector]
        Default
        Description

      Response

      Type
      Vector
      Description

    • __imul__(self, other : typing.Union[Number, Vector]) -> Vector

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        other
        Type
        typing.Union[Number, Vector]
        Default
        Description

      Response

      Type
      Vector
      Description

    • __truediv__(self, other : typing.Union[Number, Vector]) -> Vector

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        other
        Type
        typing.Union[Number, Vector]
        Default
        Description

      Response

      Type
      Vector
      Description

    • __rtruediv__(self, other : typing.Union[Number, Vector]) -> Vector

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        other
        Type
        typing.Union[Number, Vector]
        Default
        Description

      Response

      Type
      Vector
      Description

    • __itruediv__(self, other : typing.Union[Number, Vector]) -> Vector

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        other
        Type
        typing.Union[Number, Vector]
        Default
        Description

      Response

      Type
      Vector
      Description

    • __bool__(self) -> bool

      Response

      Type
      bool
      Description

    Attributes

    • Name
      x
      Type
      Decimal
      Value

      = dataclasses.field(metadata={'marshmallow_field': DecimalField()}, default=Decimal(default=0))

      Description

    • Name
      y
      Type
      Decimal
      Value

      = dataclasses.field(metadata={'marshmallow_field': DecimalField()}, default=Decimal(default=0))

      Description

    • Name
      z
      Type
      Decimal
      Value

      = dataclasses.field(metadata={'marshmallow_field': DecimalField()}, default=Decimal(default=0))

      Description

Copyright © 2024