Trig
Sage is an open source computer algebra system written in python.
The sine and cosine functions are available as sin(x) and
cos(x), and plot draws them over an interval given
as (x, a, b).
In class, we discussed how manipulating sin and cos
accounts for different types of oscillation. Writing a sinusoid as
A*sin(B*(x+C))+D separates those manipulations into four
independent knobs:
A— the amplitude, or how tall the wave isB— the frequency; the period is2*pi/BC— the phase shift, sliding the wave leftD— the vertical shift, raising the midline
The following code will plot sin(x) (blue) and
A*sin(B*(x+C))+D (green) after the user defines A,
B, C, and D. Drag the sliders and
watch which feature of the graph each one controls.
Sage also knows the exact values that live on the unit circle, rather than only decimal approximations.