← Back to Apps

Educational App

Function Cannon

Write a mathematical function, fire a projectile, and learn how curves move through the Cartesian plane.

1. Function battlefield

The cannon starts on the left. The target appears randomly on the right. The visible plane uses x from 1 to 11 and y from -10 to 10, so logarithmic functions such as log(x) are valid.

Ready. Try 1.2*x - 8, 4*sin(x), or 3*log(x) - 5.

2. Learn functions

Open a section to study each family of functions. Every card includes a short explanation, the mathematical expression, parameter definitions, a small graph, and a copyable example.

3. How the trajectory works

The user writes a function \( f(x) \). Internally, the app shifts the curve vertically so the projectile starts exactly from the cannon:

\( y = y_{\text{cannon}} + f(x) - f(x_{\text{cannon}}) \)

This preserves the shape of the function while making every projectile originate from the user circle. A hit occurs when the projectile path intersects the target circle.