float Length { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

Length (or magnitude) of the vector (Distance from 0,0,0).

Usage

To access the length of a vector, simply use the Length property on a Vector3 instance. This property returns a float representing the distance from the origin (0,0,0) to the point represented by the vector.

Example

Vector3 myVector = new Vector3(3, 4, 0);
float length = myVector.Length; // length will be 5