View source: R/wind_functions2.R
| cost.active | R Documentation |
cost.active() is a deliberately simple, general index based on signed flow
support. The flow component parallel to movement is speed * cos(angle).
Supportive flow lowers cost, opposing flow raises it, and perpendicular flow
has no effect. This is a relative index, not physical travel time or energy.
cost.active(flow.direction, flow.speed, target, speed.scale = NULL)
flow.direction |
Flow direction in degrees, pointing towards where the flow moves. |
flow.speed |
Non-negative flow speed. |
target |
Movement direction in degrees. |
speed.scale |
Positive reference speed used to make flow support dimensionless. By default, the median positive input speed is used. |
Let z = speed * cos(angle) / speed.scale. When z >= 0, cost is
1 / (1 + z); when z < 0, cost is 1 - z. Thus support equal to the
reference speed halves cost, opposition equal to the reference speed doubles
it, and cost(-z) = 1 / cost(z).
A numeric vector of relative movement costs, or a numeric array
when the input supplying the output shape is an array. Scalar inputs are
recycled to match the longer input. A value below one indicates support,
one indicates calm or perpendicular flow, and a value above one indicates
opposition. Invalid flow values give Inf, except that zero speed gives
a cost of one even when direction is missing.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.