pixijs-math

Provide 2D math primitives and transforms for PixiJS v8.

1|Updated Apr 26, 2026
One-click install
npx skills add https://github.com/matthewharwood/dean-stack --skill pixijs-math-matthewharwood
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pixijs-math
Source: https://github.com/matthewharwood/dean-stack/tree/main/.claude/skills/pixijs-math
Command: npx skills add https://github.com/matthewharwood/dean-stack --skill pixijs-math-matthewharwood

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

PixiJS apps often require robust math utilities for coordinates, transforms, hit testing, and layout calculations. This Skill bundles Point, Matrix, shape classes, and the math-extras helpers to provide a cohesive, ready-to-use math toolkit for 2D graphics and interactions.

Core Features & Use Cases

  • Point and ObservablePoint operations for precise position, velocity, and constraints.
  • 2D affine Matrix transforms with apply, applyInverse, decompose, and coordinate conversions toGlobal/toLocal.
  • Shape primitives (Rectangle, Circle, Ellipse, Polygon, RoundedRectangle, Triangle) with contains and stroke testing for hit areas and interactions.
  • Rectangle layout helpers (pad, fit, enlarge, ceil, scale) and Polygon geometry utilities (containsPolygon, isClockwise) for UI and physics-like logic.
  • Math-extras integration for vector math on Point and Rectangle, and utilities like lineIntersection and segmentIntersection.

Quick Start

Import pixi.js/math-extras to enable extended math utilities and start using Point/Matrix and hit-testing utilities in your PixiJS v8 project.

Frequently Asked Questions about pixijs-math

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert global coordinates to local coordinates in PixiJS v8?

Global to local coordinate conversion in PixiJS v8 uses 2D affine Matrix transforms with apply, applyInverse, and native toGlobal/toLocal helpers to translate points across coordinate spaces.

How do I perform hit testing on PixiJS graphics primitives?

Hit testing on PixiJS graphics primitives uses shape classes like Rectangle, Circle, and Polygon with contains and stroke testing functions to detect interactions within defined hit areas.

Can I use vector math operations on Point and Rectangle objects in PixiJS?

Vector math operations on Point and Rectangle objects require importing pixi.js/math-extras, which extends native types with utilities like lineIntersection and segmentIntersection.

Does PixiJS v8 include built-in 2D affine matrix decomposition for transforms?

PixiJS v8 provides 2D affine Matrix transforms with a decompose function, allowing you to break down complex rendering and physics transforms into translation, rotation, and scale components.