PiMath API
    Preparing search index...

    Class Line

    A line of the plane, stored by the coefficients of ax + by + c = 0 and a point of the line. Built from an equation ("2x+3y-6=0"), two points, a point and a direction vector, or three coefficients. The output defaults to the canonical form; asCartesian, asMxh, asParametric and asSystem choose another one for the next tex or display only.

    new Line("2x+3y-6=0").slope.display // "-2/3"
    

    Implements

    Index
    PARALLEL: LineProperty = LineProperty.Parallel

    Constant to give to fromPointAndLine: build the parallel line.

    PERPENDICULAR: LineProperty = LineProperty.Perpendicular

    Constant to give to fromPointAndLine: build the perpendicular line.

    • get asCanonical(): this

      Output option for the next tex or display: ax+by+c=0 (default). Chainable.

      Returns this

    • get asCartesian(): this

      Output option for the next tex or display: ax+by=-c. Chainable.

      Returns this

    • get asMxh(): this

      Output option for the next tex or display: y=mx+h, or x=k for a vertical line. Chainable.

      Returns this

    • get asParametric(): this

      Output option for the next tex or display: a point and a direction vector. Chainable.

      Returns this

    • get asSystem(): this

      Output option for the next tex or display: the parametric system of x and y. Chainable.

      Returns this

    • Full duplicate of this instance, including display state (selected form and options set via as*** / with***). Distinct from copy.

      Returns this

    • 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

    • True when both lines are the same line, whatever their coefficients.

      Parameters

      Returns boolean

    • True when the lines have the same direction but are not the same line.

      Parameters

      Returns boolean

    • Replace the line with an equation, another line, two points, a point and a vector, or three coefficients.

      Parameters

      • ...values: unknown[]

      Returns this

      if the arguments do not describe a line.

    • A random point of the line: the point OA moved along the direction vector by a non-zero integer between -k and k.

      Parameters

      • Optionalk: number

        largest multiple of the direction vector (default 3).

      Returns Point

    • Give the equation the smallest integer coefficients with no common divisor.

      Returns this

    • Show the coefficients as decimals with digits digits, in every output mode. Persistent (copied by clone()); null goes back to the exact output.

      Parameters

      • digits: number | null

      Returns this

      if digits is neither null nor an integer from 0 to 100.