↑ 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()
(px,py)
where the visible range is x∈[px-wx,px+wx]
and y∈[py-wy,py+wy]
by assuming w==h
.
The resolution will be w*h
pixels.
s: System
"q"
(quit) is pressed.
f
as y=f(x)
,
using n
points for x∈[px-wx,0]
and
n
points for x∈[0,px+wx]
.
f
as [x,y]=f(t)
using n
points for t∈[t0,t1]
.
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:
rng = rand(s.palette) s.rgb(*rng())
Patches plotlib with functionality to draw zero sets.
A basic example:
use plotlib: system use plotlib.implicit s = system() s.plot_zero_set(|x,y| x^2-y^2-1) s.idle()Type System,
s: System
F(x,y)=0
.
A large line density needs a large m
.
If there are gaps, try to increase m
to 20 or 100.
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.