Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. LÖVE
  3. Cirno's Perfect Math Library

Cirno's Perfect Math Library

NOASSERTIONLuav1.0.0

A comprehensive Lua math library for 2D/3D game development, providing vectors, matrices, quaternions, and geometric operations.

Visit WebsiteGitHubGitHub
349 stars43 forks0 contributors

What is Cirno's Perfect Math Library?

Cirno's Perfect Math Library (CPML) is a Lua library that provides essential mathematical functions for 2D and 3D game development. It includes operations for vectors, matrices, quaternions, and geometric calculations like line intersections and ray casting, solving the need for a reliable, game-focused math toolkit in Lua.

Target Audience

Game developers using Lua, particularly those working with LÖVE or LuaJIT, who need performant and consistent mathematical operations for 2D/3D graphics and physics.

Value Proposition

Developers choose CPML for its comprehensive feature set tailored to game math, consistent API across quaternions and matrices, and seamless integration with LuaJIT and LÖVE, ensuring high performance and reliability in real-time applications.

Overview

Cirno's Perfect Math Library: Just about everything you need for 2D/3D games. Hopefully.

Use Cases

Best For

  • Building 2D or 3D games in Lua with LÖVE
  • Implementing 3D transformations and rotations using quaternions
  • Performing geometric calculations like ray casting and line intersections
  • Developing game engines or frameworks that require vector and matrix math
  • Optimizing math operations with LuaJIT for better performance
  • Creating educational tools or prototypes for game math concepts

Not Ideal For

  • Developers working in programming languages other than Lua or LuaJIT.
  • Projects requiring 4D or higher-dimensional mathematical operations beyond 2D/3D.
  • Applications needing integrated physics engines or advanced simulation tools, as CPML focuses on core math utilities.
  • Teams preferring a math library with broader language support or no framework dependencies, given its tight integration with LÖVE.

Pros & Cons

Pros

Game-Focused Math Toolkit

Provides comprehensive operations for 2D/3D vectors, matrices, and quaternions, specifically tailored for real-time game development, as highlighted in the README's focus on geometric calculations like ray casting.

Consistent API Design

From version 1.0, matrix and quaternion composition rules are unified to 'apply b, then a', eliminating pre-1.0 inconsistencies and reducing user errors, as noted in the README's version compatibility section.

LuaJIT Optimization

Optimized for LuaJIT, ensuring high-performance math operations critical for games, with the README explicitly stating it's intended for use with LuaJIT.

Seamless LÖVE Integration

Serves as the backbone for LÖVE3D and integrates smoothly with the LÖVE framework, making it a natural choice for LÖVE users, as mentioned in the GitHub description.

Cons

Version 1.0 Breaking Changes

The major compatibility break at version 1.0, where composition rules changed, can cause migration issues and require code updates for existing projects, as admitted in the README.

Lua-Only Ecosystem

Tied exclusively to Lua and LuaJIT, limiting its usefulness in multi-language projects or environments not using Lua, despite its performance benefits.

No Advanced Features

Focuses on core mathematical operations; lacks higher-level features like physics simulation or animation systems, which might require additional libraries for full game development.

Frequently Asked Questions

Quick Stats

Stars349
Forks43
Contributors0
Open Issues14
Last commit4 months ago
CreatedSince 2014

Tags

#quaternions#geometry#math#3d-graphics#game-development#matrix-operations#lua#love2d#2d-graphics#vector-math#math-library

Built With

L
LuaJIT
L
Lua

Links & Resources

Website

Included in

LÖVE4.3k
Auto-fetched 6 hours ago

Related Projects

delaunaydelaunay

Delaunay triangulation for convex polygon

Stars109
Forks17
Last commit8 years ago
MLibMLib

A math and collisions library for Lua.

Stars90
Forks12
Last commit2 years ago
shashshash

A simple, lightweight spatial hash for Lua

Stars79
Forks4
Last commit4 years ago
brinevectorbrinevector

A simple ffi-accelerated vector library for everyone

Stars65
Forks3
Last commit3 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub