Mathematics · simulator made with AI

Trigonometric functions

Move the parameters a, b, c, and d and see what each one does to the graph. The gray curve is the original function, without parameters, for comparison.

f(x) = a + b·sin(c·x + d)

Parameters

Adds a value to the whole function.
Multiplies the result of the sine or the cosine.
Multiplies x, inside the function.
Adds a value to the angle, inside the function.

With the current values

f(x) sin(x), the original function (a = 0, b = 1, c = 1, d = 0) one period of f
Amplitude
|b|
Period
2π ÷ |c|
Range
from a − |b| to a + |b|
Horizontal shift
−d ÷ c
Question: what does each parameter do to the graph? Which one changes the period? Before moving anything, make a prediction.
The request that generated this simulator
Create an interactive simulator in a single HTML file (HTML, CSS, and JavaScript together, no external libraries and no server), in English. Reply only with the complete code, in a single block, from <!DOCTYPE html> to </html>, without using Python and without creating files.

TOPIC: [trigonometric functions: f(x) = a + b·sin(c·x + d)]
FOR WHOM: [11th grade] students, subject [Mathematics].
WHAT THE STUDENT CAN CHANGE: [sliders for a, b, c, and d, and a button to switch between sine and cosine].
WHAT APPEARS ON SCREEN: [the graph of f(x) from −2π to 2π, the graph of sin(x) in gray for comparison, and the calculated amplitude, period, and range].
QUESTION THE SIMULATOR HELPS ANSWER: [what does each parameter do to the graph? Which one changes the period?]
EXTRAS: a "Reset" button, the x axis marked in multiples of π, large fonts for projecting in class.