Lightweight
No unnecessary dependencies or legacy code. Designed to deliver maximum performance with a minimal memory footprint in production game environments.
A modular and lightweight library for precise mathematical and physical calculations. Created for absolute simplicity and seamless extensibility.
Get Started on GitHubNo unnecessary dependencies or legacy code. Designed to deliver maximum performance with a minimal memory footprint in production game environments.
Structured division into packages like org.rrgames.math.statistics and org.rrgames.physics.dynamics. Use exactly the modules your project needs.
Calculations work natively with modern interfaces and varargs to process flexible data streams without runtime overhead.
Process statistical data analysis in no time directly within your codebase. The module provides essential tools out-of-the-box:
import org.rrgames.math.statistics.Average;
import org.rrgames.math.statistics.Median;
import org.rrgames.math.statistics.Percentile;
Double avg = Average.get(10.0, 20.0, 30.0, 40.0);
Double med = Median.get(10.0, 20.0, 30.0);
Percentile p = new Percentile(0.25, false);
Double value = Percentile.get(200.0, p);
import org.rrgames.math.geometry.objects.Triangle;
import org.rrgames.math.geometry.ObjectArea;
import org.rrgames.physics.dynamics.Dynamics;
import java.util.Map;
GeometricalObject tri = new Triangle();
Map<String, Double> vars = Map.of("a", 3.0, "b", 4.0, "c", 5.0);
double area = ObjectArea.calculate(tri, vars);
double v = Dynamics.calculateVelocity(100.0, 5.0);
double p = Dynamics.calculateMomentum(80.0, v);
Decouple structure from logic: Calculate complex geometric shapes dynamically via variable maps or utilize precise equations of classical mechanics: