↑ Up |
Computer graphics interface.
x
seconds. Note that x
may
be a floating point number und thus parts of a second are possible.
w
and
height h
pixels.
c: Canvas
c
by RGB color.
Note: r,g,b
∈[0,1].
c
to the screen.
This operation is somewhat time consuming and thus should
not be done before a larger bunch of pixels is drawn.
w
and height h
pixels at pixel (x,y)
.
r,g,b,a
∈[0,1].
h
∈[0,2π] and s,l
∈[0,1].
(x,y)
.
This operation uses the device independent coordinate system
instead of pixel coordinates.
r
at position
(x,y)
. This operation uses the device independent
coordinate system instead of pixel coordinates.
r
at position
(x,y)
. This operation uses the device independent
coordinate system instead of pixel coordinates.
r
at position
(x,y)
. This operation uses the device independent
coordinate system instead of pixel coordinates.
Graphing data and functions.
A basic example:
use plotlib: system use math: pi, sin s = system() s.plot(|x| sin(pi*x)) s.idle()
w*h
pixels.
s: System
"q"
(quit) is pressed.
f
.
f
as [x,y]=f(t)
using n
points for t∈[t0,t1]
.
F(x,y)==0
.
Uses the bisection method with a maximum of N
iterations,
applied to n
subintervals. A larger value of n
leads to better results. For high quality plots, set
the fibration density to density=2
or larger.
z=F(x,y)
by color. The color change frequency
is given by freq
. Alpha blending is adjusted by
alpha
. The integer number
n
is the raster size in pixels.
f
as w=f(x+y*1i)
where the color (HSL) is H=arg(w)
and
L
depends on abs(w)
. The integer number
n
is the raster size in pixels.
[x1,y1]=p1
to [x2,y2]=p2
.
[x1,y1]=p1
to [x2,y2]=p2
.
[x,y]=a[k]
.
The type
is "disc"
, "circle"
or "box"
.
callback(tstep)
until "q"
(quit)
is pressed. The argument tstep
is a stroboscope that
you can scale to obtain your preferred time parameter.
Note that if the FPS is too slow, you might want to compute
an animated gif instead. That is currently not supported, but planned for
the future.
s.plot(f)
and s.vplot(f)
the color is changed automatically to the next one in the palette.
This is turned off by s.lock_color()
in order
to achieve unimpaired manual control over the color state.
Note that s.animate(callback)
automatically applies s.lock_color()
.
n≥0
from
the color palette. If n
is out of bounds,
n%size
is used.
[r,g,b]
colors.
A random color is picked this way:
rand = rng(s.palette) s.rgb(*rand())
netpbm
is
required for PNG and JPEG.