High-Performance Mathematics,
built for Java Developers.

A modular and lightweight library for precise mathematical and physical calculations. Created for absolute simplicity and seamless extensibility.

Get Started on GitHub

Lightweight

No unnecessary dependencies or legacy code. Designed to deliver maximum performance with a minimal memory footprint in production game environments.

Modular Architecture

Structured division into packages like org.rrgames.math.statistics and org.rrgames.physics.dynamics. Use exactly the modules your project needs.

Dynamic Datasets

Calculations work natively with modern interfaces and varargs to process flexible data streams without runtime overhead.

The Statistics Module

Process statistical data analysis in no time directly within your codebase. The module provides essential tools out-of-the-box:

  • Arithmetic mean (Average)
  • Median determination with automatic balance for even data sets
  • Versatile percentage calculations via the intuitive Percentile object
Example.java
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);
GeometryPhysics.java
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);

Geometry & Physics

Decouple structure from logic: Calculate complex geometric shapes dynamically via variable maps or utilize precise equations of classical mechanics:

  • Formula extraction and area calculation via ObjectArea and ObjectOutline
  • Full kinematics (velocity, distance, time) including inverse functions
  • Momentum and mass calculations in the dedicated dynamics module