Vector2 Normal { get; set; }

robot_2Generated
code_blocksInput

Description

The Normal property of the Vector2 struct returns a normalized version of the vector. A normalized vector has a length of one, which means it retains its direction but scales its magnitude to one. This is useful for direction calculations where the magnitude is not important.

Usage

To access the Normal property, simply call it on an instance of Vector2. This property is read-only and does not modify the original vector.

Example

Vector2 vector = new Vector2(3, 4);
Vector2 normalizedVector = vector.Normal;
// normalizedVector now has a length of 1, maintaining the direction of the original vector.