Main
Vectors
Matrix
Matrix Manipulation
Transformation Matrices
Angles
Random
Bezier Curve
Equations
Path Movement
Color
Linear Interpolation
Derivatives
Collision Detection
Animation
Circle And Ellipse
Sequence
Combinatorics
Other

Sine Wave Movement

import { ellipseMovement, Vector2 } from 'mz-math';

const amplitude = 100; // the peak deviation of the function from zero
const frequency = 0.003; // number of cycles
const phase = 0; // starting point "shifting"
const x = 0; // changes from 0 to .... N
const newPosition: Vector2 = ellipseMovement(x, amplitude, frequency, phase);

Example