format
typescript
Vector4.magnitudeclass: 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_name | type | description |
|---|
reture
| type | description |
|---|---|
number | The length of the vector. |
code example
typescript
let lhs = new Vector4(1, 2, 3, 4);
Debug.Log(lhs.magnitude);