Vector2 Normal { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The Normal property of the Vector2 struct returns a normalized version of the vector, which means it has the same direction but a length of one. This is useful for obtaining the direction of the vector without considering its magnitude.

Usage

To use the Normal property, simply access it from an instance of Vector2. This property is read-only and will return a new Vector2 instance that is the normalized version of the original vector.

Example

Vector2 myVector = new Vector2(3, 4);
Vector2 normalizedVector = myVector.Normal;
// normalizedVector is now (0.6, 0.8)