PiMath API
    Preparing search index...

    Class TupleNAbstract

    Base contract of every PiMath value object: a displayable, duplicable mathematical entity.

    Note: construction (parse / from***) is intentionally NOT part of this contract — input shapes are class-specific and handled per class, not polymorphically. See .claude/specs/pimath-architecture.md.

    Hierarchy (View Summary)

    Implements

    Index
    • get dimension(): number

      Number of coordinates: 2 in the plane, 3 in space.

      Returns number

    • get onChange(): (() => void) | undefined

      Function called when a coordinate is set through x, y or z, or when the tuple is zeroed. Triangle uses it to refresh its remarkable lines.

      Returns (() => void) | undefined

    • set onChange(value: (() => void) | undefined): void

      Parameters

      • value: (() => void) | undefined

      Returns void

    • Copy the mathematical state of another instance into this (display state is NOT transferred — the receiver keeps its own formatting). Entry point used when constructing/parsing from a same-type input. Distinct from clone. Classes without a real implementation throw NotImplementedError.

      Parameters

      Returns this

    • Change the number of coordinates: new ones are zero, extra ones are removed.

      Parameters

      • value: number = 2

      Returns this

      if value is less than 2.

    • Strips optional outer parentheses, splits on , ; or space, and returns the parsed Fraction array.

      Parameters

      • value: string

      Returns Fraction[]

      if fewer than 2 components are found.