pixijs-math

Solve 2D geometry and coordinate transformation tasks for PixiJS v8.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a comprehensive set of 2D math primitives and helpers for PixiJS v8, enabling precise geometry, transforms, and hit testing.

Core Features & Use Cases

  • Point and Vector primitives (Point, ObservablePoint)
  • Matrix transforms, decompose/apply/inverse, and coordinate conversions (toGlobal/toLocal)
  • Shapes and hit-testing: Rectangle, Circle, Ellipse, Polygon, RoundedRectangle, Triangle
  • Rectangle layout helpers and math-extras utilities for extended vector operations

Quick Start

To get started, load this skill and start applying Point, Matrix, and Rectangle helpers to build transforms and hit tests in PixiJS.

Frequently Asked Questions about pixijs-math

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

FAQPage Schema
How do I calculate 2D coordinate transformations for sprites in PixiJS v8?

You can calculate 2D coordinate transformations using matrix operations to apply, decompose, or invert transforms, alongside toGlobal and toLocal functions for converting coordinates across containers and scenes.

What is the best way to perform hit-testing on polygons and circles in PixiJS?

Hit-testing against shapes like polygons, circles, and rectangles is handled by applying shape primitives to define precise hit areas and calculate intersections for interactive containers.

Does PixiJS provide built-in math helpers for vector operations and point layouts?

Yes, PixiJS includes Point and ObservablePoint primitives, rectangle layout helpers, and math-extras utilities to perform extended vector operations and layout calculations.

How do I convert global coordinates to local coordinates within a nested PixiJS container?

Global to local coordinate conversions are performed using matrix transforms and inverse calculations to accurately map scene points to the local space of nested sprites and containers.

When do I need to use matrix decomposition for 2D transforms in PixiJS?

Matrix decomposition is needed when separating a composite 2D transform into its translation, rotation, and scale components to manipulate individual properties of sprites and shapes.