programlibs/Polynomials/demos/curve.xtl

A curve through five points: the polynomial of degree 4 through them (solving with the Matrix library), where it crosses zero, where it turns (the roots of its derivative), and its picture. Run with "just demo Polynomials curve".

source · imports py: libs/Polynomials/src/Polynomials.xtl libs/Polynomials/src/Polynomials.xtlm; mx: libs/Matrix/src/Matrix.xtl

x : Float

value · line 9
x ← -2.0 -1.0 0.0 1.0 2.0

y : Float

value · line 10
y ← 3.0 -1.0 1.0 -1.0 3.0
Used in: c

V : Float

value · line 13
V ← x '{ a b → a ^ b } t̲able 4.0 3.0 2.0 1.0 0.0
Used in: c

c : Float

value · line 14
c ← y ᵐˣs̲olve V

t : Float

value · line 22
t ← -2.0 + (f̲loat o̲ffsets 81) ÷ 20.0
Used in: picture

picture : Char

value · line 23
picture ← ⎕S̲HOW ⎕P̲ATH 2 81 r̲eshape t c̲at c ᵖʸa̲t t