Returns an integer vector that runs perpendicular to this one.
Returns an integer vector that runs perpendicular to this one.
The Perpendicular
property of the Vector2Int
struct provides a way to obtain a vector that is perpendicular to the current vector. This is useful in various mathematical and graphical computations where orthogonal vectors are needed.
For a vector (x, y)
, the perpendicular vector is (-y, x)
. This property automatically computes and returns this perpendicular vector.
Vector2Int vector = new Vector2Int(3, 4); Vector2Int perpendicularVector = vector.Perpendicular; // perpendicularVector is now (-4, 3)