Skip to content

format

typescript
Vector4.magnitude

class: Vector4

description

(Read Only) Returns the length of this vector.

This method is an accurate way to calculate the length of a vector, it returns the actual length of the vector. It is achieved by computing the square sum of each component of the vector and then taking the square root.

parameter

param_nametypedescription

reture

typedescription
numberThe length of the vector.

code example

typescript
let lhs = new Vector4(1, 2, 3, 4);
Debug.Log(lhs.magnitude);