Qu

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

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

-1.0 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1.0 0 1 2 3 4 5 6
Drawn by running the program above.

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