metR (version 0.6.0)

Mag: Magnitude of a vector

Description

Computes the magnitude of a vector of any dimension.

Usage

Mag(...)

Arguments

...

numeric vectors of coordinates or list of coordinates

Value

A numeric vector the same length as each element of ... that is \(\sqrt(x^2 + y^2 + ...)\).

Details

Helpful to save keystrokes and gain readability when computing wind (or any other vector quantity) magnitude.

See Also

Other utilities: Anomaly(), JumpBy(), Percentile(), logic

Examples

Run this code
# NOT RUN {
Mag(10, 10)
Mag(10, 10, 10, 10)
Mag(list(10, 10, 10, 10))

# There's no vector recicling!
# }
# NOT RUN {
Mag(1, 1:2)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab