Magnitude

The magnitude operation is defined for 1D, 2D, 3D vectors and quaternions:

vecmath> a = 5.0
vecmath> ma = |a|
vecmath> print ma
1
2
3

The (logical) output is:

ma = [5]
1

For a 2d vector:

vecmath> b = [5,12]
vecmath> mb = |b|
vecmath> print mb
1
2
3

the output is:

vecmath> mb = [13]
1

For a 3d vector:

vecmath> c = [3,8,-2]
vecmath> mc = |c|
vecmath> print mc
1
2
3

the output is:

vecmath> mc = [8.77496]
1

For a quaternion:

vecmath> q = [3,(1,-2,4)]
vecmath> mq = |q|
vecmath> print mq
1
2
3

the output is:

vecmath> mq = [5.47723]
1