Install any skill in seconds. Free to start, no credit card required.
Get Started Free →jame581/math-essentials
Use when implementing game math — vectors, transforms, interpolation, curves, random number generation, and common geometric recipes
Passed 22 of 22 test cases with the skill, and 21 of 22 without it.
1 fixed21 passed either way0 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
A test case the skill fixed. Same model, same prompt, with and without the skill.
In Godot 4 GDScript, I need to check if a target node is within a 90-degree forward vision cone (dot product threshold > 0.7) relative to my 2D entity's facing direction. Show me how to calculate the alignment value using vector math.
| Checked | Without skill | With skill |
|---|---|---|
| Computes normalized direction vector to target using direction_to. | Missed | Passed |
| Uses the dot product between forward vector and target direction. | Passed | Passed |
The instructions your model reads when the skill loads.
All examples target Godot 4.3+ with no deprecated APIs. GDScript is shown first, then C#.
Related skills: player-controller for movement physics, ai-navigation for pathfinding math, camera-system for camera interpolation, tween-animation for easing curves, physics-system for collision math.
| Method | Returns | Description |
|---|---|---|
length() | float | Magnitude of the vector |
length_squared() | float | Squared magnitude (faster, skip sqrt) |
normalized() | Vector | Unit vector (length 1) in the same direction |
distance_to(b) | float | Distance between two points |
distance_squared_to(b) | float | Squared distance (faster for comparisons) |
direction_to(b) | Vector | Normalized direction from this to b |
angle_to(b) | float | Angle in radians between two vectors |
angle_to_point(b) | float | Angle from this point to b (2D) |
dot(b) | float | Dot product |
cross(b) | float/Vector3 | Cross product (2D returns float, 3D returns vector) |
rotated(angle) | Vector2 | Rotated by radians (2D) |
move_toward(to, delta) | Vector | Move toward target by at most delta |
clamp(min, max) | Vector | Clamp each component |
snapped(step) | Vector | Snap to grid |
reflect(normal) | Vector | Reflect off a surface |
bounce(normal) | Vector | Bounce off a surface (inverted reflect) |
slide(normal) | Vector | Slide along a surface |
# Get direction from A to B (normalized)
var dir: Vector2 = global_position.direction_to(target.global_position)
# Get distance
var dist: float = global_position.distance_to(target.global_position)
test cases passed, vs 21 / 22 without
Published skills whose descriptions closely match this one, with their headline benchmark lift.
More skills from the same source and nearby in the registry, with their headline benchmark lift.