unity math + 2D rigid body helpers
Vector2Math
01 Syntax
Microsoft.VisualBasic.Imaging.Physics.Vector2Math
02 Methods
| Name | Overloads | Summary |
|---|---|---|
| Cross | 3 | Scalar (2D) cross product a × b. |
| Normalize | 1 | Normalize; returns Zero when the vector is zero-length. |
| Perpendicular | 1 | Perpendicular (rotated +90°): (-y, x). |
| Rotate | 1 | Rotate vector by angle (radians) counter-clockwise. |
| Abs | 1 | |
| Dot | 1 | |
| saturate | 1 | |
| LengthSquared | 1 | |
| Length | 1 | |
| Distance | 1 |
03 Members
Cross(
Vector2, Vector2)Scalar (2D) cross product a × b.
Cross(
Vector2, Double)Cross of a vector with a scalar: a × s = (s·a.y, -s·a.x).
Cross(
Double, Vector2)Cross of a scalar with a vector: s × a = (-s·a.y, s·a.x).
Normalize(
Vector2)Normalize; returns Zero when the vector is zero-length.
Perpendicular(
Vector2)Perpendicular (rotated +90°): (-y, x).
Rotate(
Vector2, Double)Rotate vector by angle (radians) counter-clockwise.
Abs(
Vector2)Dot(
Vector2, Vector2)saturate(
Single)LengthSquared(
Vector2)Length(
Vector2)Distance(
Vector2, Vector2)