powered by
Computes the magnitude of a vector of any dimension.
Mag(...)
numeric vectors of coordinates or list of coordinates
A numeric vector the same length as each element of ... that is \(\sqrt(x^2 + y^2 + ...)\).
Helpful to save keystrokes and gain readability when computing wind (or any other vector quantity) magnitude.
Other utilities: Anomaly, JumpBy, Percentile, logic
Anomaly
JumpBy
Percentile
logic
# 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