Number of coordinates: 2 in the plane, 3 in space.
ASCIIMath rendering of the current state (terminal output, not chainable).
Euclidean norm, as a decimal number.
Square of the norm, as an exact fraction.
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.
LaTeX rendering of the current state (terminal output, not chainable).
Third coordinate. Setting it accepts a fraction, a number or a string.
Returns a deep copy of the raw coordinate array. Unlike clone(), returns a Fraction[], not a TupleN instance.
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.
True when both points have the same dimension and the same coordinates.
True when the point is (x, y).
True when every coordinate is zero.
Change the sign of every coordinate.
Replace the coordinates with numbers, a string, a point or a vector.
Set every coordinate to zero.
StaticfromBuild a point from a string such as "(1;2)", "1,2" or "1 2 3": at least two coordinates, separated
by ,, ; or a space.
StaticmiddleProtected StaticparseStrips optional outer parentheses, splits on , ; or space, and returns the parsed Fraction array.
A point of the plane or of space, with exact coordinates. Built from numbers (
new Point(1, 2)), from a string ("(1;2)") or from another point or vector. Thex,yandzcoordinates are fractions.Example