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

Circle Movement

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

const center: Vector2 = [100, 100];
const radiansAngle = Math.PI/2; // Angle should be in the range [0, Math.PI]
const radius = 250; 
const newPosition: Vector2 = circleMovement(center, radiansAngle, radius);

Example

Circle movement after mouse

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

const mouse = [evt.clientX, evt.clientY];
const center: Vector2 = [100, 100];
const radius = 250;

const position: Vector2 = circleMovementAfterMouse(mouse, center, radius);

Example