Vector2Int Perpendicular { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

Returns an integer vector that runs perpendicular to this one.

Usage

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.

Example

Vector2Int vector = new Vector2Int(3, 4);
Vector2Int perpendicularVector = vector.Perpendicular;
// perpendicularVector is now (-4, 3)