Getting started
Plot a sine wave
plot a sine wave.
catalog/demo_sine.qu
The simplest possible version of the thing Qu is built for: a time axis, a waveform, and a plot. No filtering, no noise, no units -- just sin().
What it exercises
- to (range), elementwise sin(), plot(), show plot
How it works
Make a sine wave
t = 0 to 2 * pi step 0.05
y = sin(t)
Plot it
plot(t, y)
show plot
Results
The whole program
Runnable as it stands: qu run catalog/demo_sine.qu
# demo_sine.qu — plot a sine wave.
#
# The simplest possible version of the thing Qu is built for: a time axis,
# a waveform, and a plot. No filtering, no noise, no units -- just sin().
#
# Exercises:
# to (range), elementwise sin(), plot(), show plot
backend auto
#%% Make a sine wave
t = 0 to 2 * pi step 0.05
y = sin(t)
#%% Plot it
plot(t, y)
show plot