Math
parcadei/Continuous-Claude-v3
Unified math capabilities - computation, solving, and explanation.
A skill your agent uses when using Phaser 4 math and geometry utilities.
$ npx skills add autonomous-ai/openharness --skill geometry-and-math -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install autonomous-ai/openharness geometry-and-math --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/autonomous-ai/openharness.git skills-src && mkdir -p .claude/skills && cp -r skills-src/store/agents/phaser/skills/geometry-and-math .claude/skills/geometry-and-math && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "geometry-and-math" agent skill from https://github.com/autonomous-ai/openharness/tree/main/store/agents/phaser/skills/geometry-and-math into .claude/skills/geometry-and-math/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "geometry-and-math", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/autonomous-ai/openharness/tree/main/store/agents/phaser/skills/geometry-and-mathType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add autonomous-ai/openharness --skill geometry-and-math -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install autonomous-ai/openharness geometry-and-math --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/autonomous-ai/openharness.git skills-src && mkdir -p .agents/skills && cp -r skills-src/store/agents/phaser/skills/geometry-and-math .agents/skills/geometry-and-math && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "geometry-and-math" agent skill from https://github.com/autonomous-ai/openharness/tree/main/store/agents/phaser/skills/geometry-and-math into .agents/skills/geometry-and-math/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "geometry-and-math", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add autonomous-ai/openharness --skill geometry-and-math -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install autonomous-ai/openharness geometry-and-math --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/autonomous-ai/openharness.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/store/agents/phaser/skills/geometry-and-math .cursor/skills/geometry-and-math && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "geometry-and-math" agent skill from https://github.com/autonomous-ai/openharness/tree/main/store/agents/phaser/skills/geometry-and-math into .cursor/skills/geometry-and-math/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "geometry-and-math", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/autonomous-ai/openharness.git --path store/agents/phaser/skills/geometry-and-math--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add autonomous-ai/openharness --skill geometry-and-math -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install autonomous-ai/openharness geometry-and-math --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/autonomous-ai/openharness.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/store/agents/phaser/skills/geometry-and-math .gemini/skills/geometry-and-math && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "geometry-and-math" agent skill from https://github.com/autonomous-ai/openharness/tree/main/store/agents/phaser/skills/geometry-and-math into .gemini/skills/geometry-and-math/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "geometry-and-math", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install autonomous-ai/openharness geometry-and-mathInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add autonomous-ai/openharness --skill geometry-and-math -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/autonomous-ai/openharness.git skills-src && mkdir -p .github/skills && cp -r skills-src/store/agents/phaser/skills/geometry-and-math .github/skills/geometry-and-math && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "geometry-and-math" agent skill from https://github.com/autonomous-ai/openharness/tree/main/store/agents/phaser/skills/geometry-and-math into .github/skills/geometry-and-math/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "geometry-and-math", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add autonomous-ai/openharness --skill geometry-and-math -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install autonomous-ai/openharness geometry-and-math --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/autonomous-ai/openharness.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/store/agents/phaser/skills/geometry-and-math .opencode/skills/geometry-and-math && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "geometry-and-math" agent skill from https://github.com/autonomous-ai/openharness/tree/main/store/agents/phaser/skills/geometry-and-math into .opencode/skills/geometry-and-math/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "geometry-and-math", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
geometry-and-mathA skill your agent uses when using Phaser 4 math and geometry utilities.
Geometry And Math is an agent skill from autonomous-ai/openharness. Use this skill when using Phaser 4 math and geometry utilities. Covers vectors, rectangles, circles, triangles, polygons, random number generation, angles, distance, interpolation, and snapping. Triggers on: Vector2, Rectangle, Circle, math, distance, angle, random, lerp.
Its SKILL.md is about 5.9k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
The repository describes itself as: The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across… The licence is MIT.
10 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 74c2733. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are javascript).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Geometry And Math loads about 5.9k tokens when it runs. Until then it costs about 73 tokens; SKILL.md has 1,962 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from autonomous-ai/openharness at commit 74c2733, republished under its MIT licence (© autonomous-ai). 1,962 words, ~5,901 tokens.
.claude/skills/geometry-and-math/SKILL.md (or your agent's skills folder).Geom classes (Circle, Ellipse, Line, Polygon, Rectangle, Triangle), intersection tests, and Math utilities (Vector2, Vector3, Matrix4, angles, distances, interpolation, easing, random, snap, clamp).
Related skills: graphics-and-shapes.md, physics-arcade.md
// Create geometry objects (these are data only, not renderable)
const rect = new Phaser.Geom.Rectangle(10, 20, 200, 100);
const circle = new Phaser.Geom.Circle(400, 300, 50);
const line = new Phaser.Geom.Line(0, 0, 100, 100);
// Point containment
rect.contains(50, 50); // true
circle.contains(410, 310); // true
// Intersection test
Phaser.Geom.Intersects.CircleToRectangle(circle, rect); // boolean
// Math utilities
const v = new Phaser.Math.Vector2(3, 4);
v.length(); // 5
v.normalize(); // {x: 0.6, y: 0.8}
const dist = Phaser.Math.Distance.Between(0, 0, 100, 100);
const angle = Phaser.Math.Angle.Between(0, 0, 100, 100);
const clamped = Phaser.Math.Clamp(150, 0, 100); // 100Geometry objects are pure data containers holding coordinates and dimensions. They are NOT game objects and cannot be added to the display list. To render geometry, use the Graphics game object or Shape game objects (see graphics-and-shapes.md).
Every geom class has a type property set to a Phaser.Geom constant for fast type checks.
All geom classes share a common instance method pattern:
contains(x, y) -- point-in-shape testgetPoint(position, output?) -- point at normalized position (0-1) on perimetergetPoints(quantity, stepRate?, output?) -- evenly spaced points on perimetergetRandomPoint(output?) -- random point inside the shapesetTo(...) -- reset all propertiessetEmpty() -- zero out the shapesetPosition(x, y) -- move origin/centerEach geom type also has a folder of static helper functions (e.g., Phaser.Geom.Rectangle.Contains, Phaser.Geom.Circle.Area).
| Class | Namespace | Constructor | Key Properties |
|---|---|---|---|
| Circle | Phaser.Geom.Circle | (x, y, radius) | x, y, radius, diameter, left, right, top, bottom |
| Ellipse | Phaser.Geom.Ellipse | (x, y, width, height) | x, y, width, height, left, right, top, bottom |
| Line | Phaser.Geom.Line | (x1, y1, x2, y2) | x1, y1, x2, y2, left, right, top, bottom |
| Polygon | Phaser.Geom.Polygon | (points) | area, points (array of Vector2Like) |
| Rectangle | Phaser.Geom.Rectangle | (x, y, width, height) | x, y, width, height, left, right, top, bottom, centerX, centerY |
| Triangle | Phaser.Geom.Triangle | (x1, y1, x2, y2, x3, y3) | x1, y1, x2, y2, x3, y3 |
Phaser.Geom.Rectangle.*: Area, Ceil, CeilAll, CenterOn, Clone, Contains, ContainsPoint, ContainsRect, CopyFrom, Decompose, Equals, FitInside, FitOutside, Floor, FloorAll, FromPoints, FromXY, GetAspectRatio, GetCenter, GetPoint, GetPoints, GetSize, Inflate, Intersection, MarchingAnts, MergePoints, MergeRect, MergeXY, Offset, OffsetPoint, Overlaps, Perimeter, PerimeterPoint, Random, RandomOutside, SameDimensions, Scale, Union.
Phaser.Geom.Circle.*: Area, Circumference, CircumferencePoint, Clone, Contains, ContainsPoint, ContainsRect, CopyFrom, Equals, GetBounds, GetPoint, GetPoints, Offset, OffsetPoint, Random.
Phaser.Geom.Line.*: Angle, BresenhamPoints, CenterOn, Clone, CopyFrom, Equals, Extend, GetEasedPoints, GetMidPoint, GetNearestPoint, GetNormal, GetPoint, GetPoints, GetShortestDistance, Height, Length, NormalAngle, NormalX, NormalY, Offset, PerpSlope, Random, ReflectAngle, Rotate, RotateAroundPoint, RotateAroundXY, SetToAngle, Slope, Width.
Phaser.Geom.Triangle.*: Area, BuildEquilateral, BuildFromPolygon, BuildRight, CenterOn, Centroid, CircumCenter, CircumCircle, Clone, Contains, ContainsArray, ContainsPoint, CopyFrom, Decompose, Equals, GetPoint, GetPoints, InCenter, Offset, Perimeter, Random, Rotate, RotateAroundPoint, RotateAroundXY.
The Polygon constructor accepts multiple formats for the points argument:
'40 0 40 20 100 20 100 80'{x, y} objects[x1, y1, x2, y2, ...][x, y] sub-arraysAll under Phaser.Geom.Intersects.
true/false)| Function | Description |
|---|---|
CircleToCircle(circleA, circleB) | Two circles overlap |
CircleToRectangle(circle, rect) | Circle overlaps rectangle |
LineToCircle(line, circle) | Line segment intersects circle |
LineToLine(line1, line2, out?) | Two line segments cross; writes point to out |
LineToRectangle(line, rect) | Line segment intersects rectangle |
PointToLine(point, line, lineThickness?) | Point lies on/near line |
PointToLineSegment(point, line) | Point lies on finite line segment |
RectangleToRectangle(rectA, rectB) | Two rectangles overlap |
RectangleToTriangle(rect, triangle) | Rectangle overlaps triangle |
RectangleToValues(rect, left, right, top, bottom, tolerance?) | Rectangle overlaps LRTB bounds |
TriangleToCircle(triangle, circle) | Triangle overlaps circle |
TriangleToLine(triangle, line) | Triangle intersects line |
TriangleToTriangle(triA, triB) | Two triangles overlap |
Vector2[])| Function | Description |
|---|---|
GetCircleToCircle(circleA, circleB, out?) | Intersection points of two circles |
GetCircleToRectangle(circle, rect, out?) | Points where circle meets rectangle edges |
GetLineToCircle(line, circle, out?) | Points where line crosses circle |
GetLineToLine(line1, line2, out?) | Single intersection point of two lines |
GetLineToPoints(line, points, out?) | Intersection with a series of points forming edges |
GetLineToPolygon(line, polygon, out?) | Closest intersection with polygon edges |
GetLineToRectangle(line, rect, out?) | Points where line crosses rectangle |
GetRaysFromPointToPolygon(x, y, polygon) | Ray-cast from point to polygon edges |
GetRectangleIntersection(rectA, rectB, out?) | Overlapping rectangle region |
GetRectangleToRectangle(rectA, rectB, out?) | Edge intersection points |
GetRectangleToTriangle(rect, triangle, out?) | Edge intersection points |
GetTriangleToCircle(triangle, circle, out?) | Edge intersection points |
GetTriangleToLine(triangle, line, out?) | Edge intersection points |
GetTriangleToTriangle(triA, triB, out?) | Edge intersection points |
All under Phaser.Math unless noted.
| Constant | Value |
|---|---|
Phaser.Math.TAU | PI * 2 (v4 addition) |
Phaser.Math.PI_OVER_2 | PI / 2 |
Phaser.Math.EPSILON | 1.0e-6 |
Phaser.Math.DEG_TO_RAD | PI / 180 |
Phaser.Math.RAD_TO_DEG | 180 / PI |
Phaser.Math.RND | Global RandomDataGenerator instance (seeded via game config seed) |
Phaser.Math.Angle.*)| Function | Description |
|---|---|
Between(x1, y1, x2, y2) | Angle in radians between two points |
BetweenPoints(point1, point2) | Same, taking {x,y} objects |
BetweenY(x1, y1, x2, y2) | Angle from vertical axis |
BetweenPointsY(point1, point2) | Same, taking objects |
CounterClockwise(angle) | Convert to counter-clockwise |
GetClockwiseDistance(from, to) | Clockwise angular distance |
GetCounterClockwiseDistance(from, to) | Counter-clockwise angular distance |
GetShortestDistance(from, to) | Shortest angular distance (signed) |
Normalize(angle) | Normalize to [0, 2PI) |
Random() | Random angle in radians |
RandomDegrees() | Random angle in degrees |
Reverse(angle) | Reverse (add PI) |
RotateTo(currentAngle, targetAngle, lerp?) | Step toward target angle |
ShortestBetween(angle1, angle2) | Shortest difference in degrees |
Wrap(angle) | Wrap to (-PI, PI] |
WrapDegrees(angle) | Wrap to (-180, 180] |
Phaser.Math.Distance.*)| Function | Description |
|---|---|
Between(x1, y1, x2, y2) | Euclidean distance |
BetweenPoints(a, b) | Same, taking {x,y} objects |
BetweenPointsSquared(a, b) | Squared distance (avoids sqrt) |
Chebyshev(x1, y1, x2, y2) | Chebyshev (chessboard) distance |
Power(x1, y1, x2, y2, pow) | Minkowski distance with custom power |
Snake(x1, y1, x2, y2) | Manhattan/taxicab distance |
Squared(x1, y1, x2, y2) | Squared Euclidean distance |
Phaser.Math.Interpolation.*)| Function | Description |
|---|---|
BezierInterpolation(v, k) | Bezier curve through control points |
CatmullRomInterpolation(v, k) | Catmull-Rom spline through points |
CubicBezierInterpolation(t, p0, p1, p2, p3) | Cubic Bezier between four values |
LinearInterpolation(v, k) | Linear through array of values |
QuadraticBezierInterpolation(t, p0, p1, p2) | Quadratic Bezier |
SmoothStepInterpolation(t, min, max) | Hermite smooth step |
SmootherStepInterpolation(t, min, max) | Ken Perlin's smoother step |
Phaser.Math.Snap.*)| Function | Description |
|---|---|
To(value, gap, start?, divide?) | Snap to nearest increment |
Floor(value, gap, start?, divide?) | Snap down to increment |
Ceil(value, gap, start?, divide?) | Snap up to increment |
Phaser.Math.Fuzzy.*)| Function | Description |
|---|---|
Equal(a, b, epsilon?) | a approximately equals b |
LessThan(a, b, epsilon?) | a < b within epsilon |
GreaterThan(a, b, epsilon?) | a > b within epsilon |
Ceil(value, epsilon?) | Fuzzy ceiling |
Floor(value, epsilon?) | Fuzzy floor |
Phaser.Math.Easing.*)Each type has .In, .Out, .InOut variants. Used primarily by tweens (pass string names like 'Sine.easeOut').
| Type | String Keys |
|---|---|
| Back | Back.easeIn, Back.easeOut, Back.easeInOut |
| Bounce | Bounce.easeIn, Bounce.easeOut, Bounce.easeInOut |
| Circular | Circ.easeIn, Circ.easeOut, Circ.easeInOut |
| Cubic | Cubic.easeIn, Cubic.easeOut, Cubic.easeInOut |
| Elastic | Elastic.easeIn, Elastic.easeOut, Elastic.easeInOut |
| Expo | Expo.easeIn, Expo.easeOut, Expo.easeInOut |
| Linear | Linear (no variants) |
| Quadratic | Quad.easeIn, Quad.easeOut, Quad.easeInOut |
| Quartic | Quart.easeIn, Quart.easeOut, Quart.easeInOut |
| Quintic | Quint.easeIn, Quint.easeOut, Quint.easeInOut |
| Sine | Sine.easeIn, Sine.easeOut, Sine.easeInOut |
| Stepped | Stepped (no variants) |
Power aliases: Power0 = Linear, Power1 = Quad.Out, Power2 = Cubic.Out, Power3 = Quart.Out, Power4 = Quint.Out.
Short names also work: 'Quad' = Quad.Out, 'Sine' = Sine.Out, etc.
Phaser.Math)| Function | Description |
|---|---|
Between(min, max) | Random integer in [min, max] |
FloatBetween(min, max) | Random float in [min, max] |
Clamp(value, min, max) | Constrain value to range |
Wrap(value, min, max) | Wrap value within range |
Within(a, b, tolerance) | Check if a is within tolerance of b |
Percent(value, min, max, upperMax?) | Value as percentage of range |
FromPercent(percent, min, max) | Value from percentage of range |
DegToRad(degrees) | Convert degrees to radians |
RadToDeg(radians) | Convert radians to degrees |
Linear(p0, p1, t) | Lerp between two values |
LinearXY(v1, v2, t, out?) | Lerp between two Vector2Like objects |
SmoothStep(x, min, max) | Hermite smooth step |
SmootherStep(x, min, max) | Perlin smoother step |
Average(values) | Mean of number array |
Median(values) | Median of number array |
CeilTo(value, place?, base?) | Ceil to decimal place |
FloorTo(value, place?, base?) | Floor to decimal place |
RoundTo(value, place?, base?) | Round to decimal place |
RoundAwayFromZero(value) | Round away from zero |
MaxAdd(value, amount, max) | Add clamped to max |
MinSub(value, amount, min) | Subtract clamped to min |
Difference(a, b) | Absolute difference |
IsEven(value) | Integer is even |
IsEvenStrict(value) | Strictly even (not zero) |
Factorial(value) | Factorial |
Rotate(point, angle) | Rotate point around origin |
RotateAround(point, cx, cy, angle) | Rotate point around custom center |
RotateAroundDistance(point, cx, cy, angle, dist) | Rotate at fixed distance |
TransformXY(x, y, posX, posY, rotation, scaleX, scaleY, output?) | Full 2D transform |
GetSpeed(distance, time) | Speed from distance and time |
RandomXY(vector, scale?) | Set vector to random unit direction |
Phaser.Math.Pow2.*)| Function | Description |
|---|---|
GetPowerOfTwo(value) | Next power of two >= value |
IsValuePowerOfTwo(value) | Check if value is power of two |
IsSizePowerOfTwo(width, height) | Check if both dimensions are power of two |
Phaser.Math.Vector2 -- 2D vector used throughout Phaser for positions, velocities, directions.
Constructor: new Vector2(x?, y?) or new Vector2({x, y}). If only x given, y defaults to x.
| Method | Returns | Description |
|---|---|---|
set(x, y) / setTo(x, y) | this | Set components |
setToPolar(angle, length?) | this | Set from angle + length |
copy(src) / setFromObject(obj) | this | Copy from Vector2Like |
clone() | Vector2 | New copy |
add(src) / subtract(src) | this | Component-wise add/subtract |
multiply(src) / divide(src) | this | Component-wise multiply/divide |
scale(value) | this | Multiply both components by scalar |
negate() | this | Flip sign of both components |
normalize() | this | Set length to 1 |
normalizeRightHand() | this | Perpendicular (right-hand rule) |
normalizeLeftHand() | this | Perpendicular (left-hand rule) |
limit(max) | this | Cap length to max |
setLength(length) | this | Scale to exact length |
length() | number | Magnitude |
lengthSq() | number | Squared magnitude (no sqrt) |
distance(src) | number | Distance to another vector |
distanceSq(src) | number | Squared distance |
dot(src) | number | Dot product |
cross(src) | number | 2D cross product (scalar) |
angle() | number | Angle in radians from positive x-axis |
setAngle(angle) | this | Rotate to angle, keeping length |
rotate(delta) | this | Rotate by delta radians |
lerp(src, t) | this | Linear interpolate toward src |
reflect(normal) | this | Reflect off surface normal |
mirror(axis) | this | Mirror across axis vector |
project(src) | this | Project onto another vector |
equals(v) | boolean | Exact equality |
fuzzyEquals(v, epsilon?) | boolean | Approximate equality |
ceil() / floor() / invert() | this | Component transforms |
reset() | this | Set to (0, 0) |
transformMat3(mat) | this | Transform by Matrix3 |
transformMat4(mat) | this | Transform by Matrix4 |
Static: Vector2.ZERO, Vector2.RIGHT, Vector2.LEFT, Vector2.UP, Vector2.DOWN, Vector2.ONE.
Phaser.Math.Vector3 -- 3D vector for camera projections, lighting, 3D math.
Constructor: new Vector3(x?, y?, z?) or new Vector3({x, y, z}).
Key methods (same patterns as Vector2 plus): up(), min(v), max(v), addVectors(a, b), subVectors(a, b), crossVectors(a, b), cross(v), addScalar(s), addScale(v, scale), fromArray(array, offset?), setFromMatrixPosition(mat4), setFromMatrixColumn(mat4, index), applyMatrix3(mat), applyMatrix4(mat), transformCoordinates(mat), transformQuat(q), project(mat), projectViewMatrix(view, proj), unproject(viewport, invProjView).
Phaser.Math.Matrix4 -- 4x4 matrix for 3D transforms, projection, and view matrices. Backed by Float32Array(16).
Constructor: new Matrix4(m?) -- copies from existing Matrix4, or defaults to identity.
Key methods: clone(), set(src), copy(src), identity(), transpose(), invert(), adjoint(), determinant(), multiply(src), multiplyLocal(src), translate(v), scale(v), rotate(angle, axis), rotateX(angle), rotateY(angle), rotateZ(angle), fromRotationTranslation(q, v), fromQuat(q), frustum(...), perspective(fovy, aspect, near, far), perspectiveLH(width, height, near, far), ortho(left, right, bottom, top, near, far), lookAt(eye, center, up), lookAtRH(eye, target, up), setWorldMatrix(rotation, position, scale, viewMatrix?, projectionMatrix?).
Also: Phaser.Math.Matrix3 -- 3x3 matrix for 2D transforms and normal matrices.
Phaser.Math.RandomDataGenerator -- seeded PRNG. Global instance at Phaser.Math.RND (seeded via game config seed property).
const rnd = Phaser.Math.RND; // or new Phaser.Math.RandomDataGenerator(['my-seed'])
rnd.integer(); // random integer in [0, 2^32]
rnd.frac(); // random float in [0, 1)
rnd.between(1, 10); // random integer in [1, 10]
rnd.integerInRange(1, 10); // alias for between
rnd.realInRange(0.5, 1.5); // random float in [0.5, 1.5]
rnd.normal(); // normal distribution around 0
rnd.angle(); // random angle in radians (-PI to PI)
rnd.rotation(); // random rotation in radians (same range)
rnd.pick(array); // random element from array
rnd.weightedPick(array); // weighted toward end of array
rnd.sign(); // -1 or 1
rnd.uuid(); // RFC4122 v4 UUID string
rnd.shuffle(array); // in-place Fisher-Yates shuffle
rnd.state(state?); // get/set serializable state for save/loadCreate reproducible sequences by providing seeds: new RandomDataGenerator(['level-42']).
Phaser.Display.Color)A mutable RGBA color representation with automatic conversion to WebGL floats, HSV, CSS strings, and packed integers.
// Construction
const color = new Phaser.Display.Color(255, 0, 0, 255); // RGBA (0-255)
// Creation helpers (return Color instances)
const c1 = Phaser.Display.Color.ValueToColor('#ff0000'); // hex string, integer, or object
const c2 = Phaser.Display.Color.HexStringToColor('#ff0000');
const c3 = Phaser.Display.Color.RGBStringToColor('rgb(255,0,0)');
const c4 = Phaser.Display.Color.HSVToRGB(0.5, 1, 1); // returns { r, g, b, color }
// Properties
color.r; color.g; color.b; color.a; // 0-255 integers
color.redGL; color.greenGL; color.blueGL; color.alphaGL; // 0-1 floats (WebGL)
color.color; // packed 24-bit integer (0xRRGGBB)
color.color32; // packed 32-bit integer (0xAARRGGBB)
color.rgba; // CSS string 'rgba(r,g,b,a)'
color.h; color.s; color.v; // HSV representation (read-only, auto-updated)// Adjustment methods (amount is typically 0-100, returns the Color instance)
color.brighten(25); // increase brightness
color.saturate(50); // increase saturation
color.desaturate(30); // decrease saturation
color.lighten(20); // increase lightness
color.darken(10); // decrease lightness
// Utility methods
color.random(); // set to random RGB values (optional min/max range)
color.gray(128); // set to grayscale shade (0-255)
// Setting values
color.setTo(255, 128, 0, 255); // RGBA
color.setFromRGB({ r: 255, g: 128, b: 0, a: 255 });
color.setFromHSV(0.1, 0.8, 1.0); // HSV (0-1 range)Phaser.Display.Color.Interpolate)Interpolate between colors over a given length. Returns { r, g, b, a, color }.
// Between raw RGB values
const result = Phaser.Display.Color.Interpolate.RGBWithRGB(
255, 0, 0, // start color (r, g, b)
0, 0, 255, // end color (r, g, b)
100, // length (number of steps)
50 // index (current step)
); // returns midpoint purple { r, g, b, a, color }
// Between two Color objects
const mid = Phaser.Display.Color.Interpolate.ColorWithColor(color1, color2, 100, 50);
// HSV interpolation (v4): smooth hue transition
const hsvResult = Phaser.Display.Color.Interpolate.HSVWithHSV(0, 1, 1, 0.5, 1, 1, 100, 50);Geom objects are not game objects. They have no scene, no setPosition from the display list, no texture. Use Graphics or Shape game objects to render them.
Point class removed in v4. Use Phaser.Math.Vector2 or plain {x, y} objects instead. The GEOM_CONST.POINT (3) exists but the Point class does not.
Angles are in radians throughout the math API. Use Phaser.Math.DegToRad() and RadToDeg() for conversion. The Phaser.Math.TAU constant (2 * PI) is new in v4.
Vector2 methods mutate in place and return this for chaining. Call .clone() first if you need to preserve the original: const result = v.clone().add(other).
Squared distance is faster than Euclidean distance (avoids Math.sqrt). Use Distance.Squared or vec.distanceSq() for comparisons where the actual distance value is not needed.
Intersection Get functions allocate arrays.* Pass a reusable out array to avoid garbage collection pressure in hot loops.
EaseMap short names default to the .Out variant. 'Quad' means Quadratic.Out, not Quadratic.In. Use full string keys like 'Quad.easeIn' for other variants.
RandomDataGenerator state is serializable. Call rnd.state() to get a string you can store, and rnd.state(savedString) to restore it for deterministic replay.
Polygon.contains uses ray-casting (even/odd rule). Complex self-intersecting polygons may give unexpected results.
Matrix4.val is a Float32Array. Access elements directly via mat.val[index] using column-major order (OpenGL convention).
| Area | Path |
|---|---|
| Geom classes | src/geom/{circle,ellipse,line,polygon,rectangle,triangle}/ |
| Geom constants | src/geom/const.js |
| Intersection tests | src/geom/intersects/ |
| Vector2 | src/math/Vector2.js |
| Vector3 | src/math/Vector3.js |
| Vector4 | src/math/Vector4.js |
| Matrix3 | src/math/Matrix3.js |
| Matrix4 | src/math/Matrix4.js |
| Quaternion | src/math/Quaternion.js |
| Euler | src/math/Euler.js |
| Angle functions | src/math/angle/ |
| Distance functions | src/math/distance/ |
| Easing functions | src/math/easing/ (+ EaseMap.js for string keys) |
| Fuzzy comparison | src/math/fuzzy/ |
| Interpolation | src/math/interpolation/ |
| Snap functions | src/math/snap/ |
| Power-of-two | src/math/pow2/ |
| RandomDataGenerator | src/math/random-data-generator/RandomDataGenerator.js |
| Math constants | src/math/const.js |
| Color class | src/display/color/Color.js |
| Color utilities | src/display/color/ (ValueToColor, HexStringToColor, RGBStringToColor, HSVToRGB, Interpolate) |
| Core math helpers | src/math/ (Clamp.js, Between.js, Wrap.js, Linear.js, etc.) |
© autonomous-ai, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in store/agents/phaser/skills/geometry-and-math of autonomous-ai/openharness.
Open the folder on GitHubat commit 74c2733
Geometry And Math next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Geometry And Math this skillautonomous-ai/openharness | 1.2k | — | ~5.9k | Automated safety check: Pass | MIT | |
| Mathparcadei/Continuous-Claude-v3 | 3.9k | 2 repos | ~1.6k | Automated safety check: Notes | MIT | |
| Math Computationtradecatlabs/vibe-coding-cn | 17k | — | ~881 | Automated safety check: Pass | MIT | |
| Rigorous Math Prooftradecatlabs/vibe-coding-cn | 17k | — | ~571 | Automated safety check: Pass | MIT | |
| Math Olympiadanthropics/claude-plugins-official | 38k | — | ~5k | Automated safety check: Pass | Apache-2.0 | |
| Math Research Task Routertradecatlabs/vibe-coding-cn | 17k | — | ~407 | Automated safety check: Pass | MIT |
parcadei/Continuous-Claude-v3
Unified math capabilities - computation, solving, and explanation.
tradecatlabs/vibe-coding-cn
Runs reproducible math computations and counterexample searches with SymPy, NumPy and mpmath, logging evidence without presenting results as proofs.
tradecatlabs/vibe-coding-cn
Writes and audits natural-language math proofs as checkable packages, with explicit assumptions, proof obligations and counterexample hunting, refuting or repairing weak claims.
anthropics/claude-plugins-official
Solve competition math problems (IMO, Putnam, USAMO, AIME) with adversarial verification that catches the errors self-verification misses.
tradecatlabs/vibe-coding-cn
Routes an unclear math research request to exactly one specialist skill, naming the current stage, the reason, the inputs needed, a stop condition and the next step.
tradecatlabs/vibe-coding-cn
Turns a mathematical claim into a small Lean 4 and Mathlib formalization checked by the proof assistant kernel, and refuses to report a pass without real evidence.
autonomous-ai/openharness
Slices 3D mesh files into printer-profiled plain G-code through real slicer CLIs, with backend discovery, input inspection, dry runs and static validation.
autonomous-ai/openharness
Turns a home-automation request into standard, testable automations.yaml, run against Home Assistant Core's real triggers and verified with its own trace tool.
autonomous-ai/openharness
Turns a musical brief into LilyPond concert-pitch music, checked parts for each instrument and a playable practice pack.
autonomous-ai/openharness
Turns an STL and explicit printer and material requirements into compared OrcaSlicer plans, an editable 3MF project, checked G-code and a portable handoff.
autonomous-ai/openharness
Builds an editable DOCX report, a formula-driven XLSX workbook and a fresh LibreOffice PDF preview from one structured source file, then checks them together.
autonomous-ai/openharness
Dry-run, upload, and cautiously initiate local Bambu Lab print jobs from validated plain .gcode, using Bambu LAN FTPS/MQTT handoffs.
A skill your agent uses when using Phaser 4 math and geometry utilities. Geometry And Math is an agent skill from autonomous-ai/openharness. Use this skill when using Phaser 4 math and geometry utilities.
Geometry And Math fits situations like: using Phaser 4 math and geometry utilities.
Run `npx skills add autonomous-ai/openharness --skill geometry-and-math -a claude-code`. Or copy the skill folder (store/agents/phaser/skills/geometry-and-math in autonomous-ai/openharness) into .claude/skills/geometry-and-math in your project. Claude Code loads it when a task matches its description.
Run `npx skills add autonomous-ai/openharness --skill geometry-and-math -a codex`. Or copy the skill folder (store/agents/phaser/skills/geometry-and-math in autonomous-ai/openharness) into .agents/skills/geometry-and-math in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add autonomous-ai/openharness --skill geometry-and-math -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/geometry-and-math, .gemini/skills/geometry-and-math, .github/skills/geometry-and-math and .opencode/skills/geometry-and-math in your project.
SKILL.md names no scripts, command-line tools or credentials: Geometry And Math is instructions for the agent only.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Geometry And Math is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 5.9k tokens (SKILL.md is roughly 24k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Geometry And Math: Math (parcadei/Continuous-Claude-v3, 3.9k stars), Math Computation (tradecatlabs/vibe-coding-cn, 17k stars), Rigorous Math Proof (tradecatlabs/vibe-coding-cn, 17k stars) and Math Olympiad (anthropics/claude-plugins-official, 38k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
autonomous-ai (a GitHub organization) maintains it in autonomous-ai/openharness, which has 1,194 GitHub stars. The repository holds 99 skills in this directory. The repository was last updated on October 9, 2026.
Source: autonomous-ai/openharness on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.