3D Lingo Dictionary > L-N > magnitude |  |

magnitude

Syntax

    whichVector.magnitude

Description

3D property; returns the magnitude of a vector. The value is a floating-point number. The magnitude is the length of a vector and is always greater than or equal to0.0. (`vector (0, 0, 0)` equals 0.)

Example

This statement shows that the magnitude of MyVec1 is 100.0000 and the magnitude of MyVec2 is 141.4214.

    MyVec1 = vector(100, 0, 0)
    put MyVec1.magnitude
    -- 100.0000
    MyVec2 = vector(100, 100, 0)
    put MyVec2.magnitude
    -- 141.4214

See also

`length`, `identity()`