short_turn: Determines whether a point is within a short turn

Description Usage Arguments Value See Also Examples

Description

a helper function used by 'number_passes' and 'pass_end_turns' to determine whether a point lies within a short turn.

If the difference between the lag and lead directions is greater than the provided threshold the function returns 'TRUE' and a long turn is identified.

Usage

1
short_turn(lag, lead, threshold=45)

Arguments

lag

a number between 0 and 360. The first direction being compared by the function.

lead

a number between 0 and 360. The second direction being compared by the function.

threshold

a number between 0 and 180. Corresponds to the highest difference in direction which is considered not a turn.

Value

boolean. 'TRUE' if the difference between directions is greater than 'threshold', 'FALSE' otherwise.

See Also

long_turn, number_passes, narrow_passes

Examples

1
2
3
4
short_turn(100, 0) # => TRUE
short_turn(45,90)  # => FALSE
short_turn(360, 0) # => FALSE
short_turn(0, 45, threshold=60) # => FALSE

jillianderson8/cydr documentation built on May 19, 2019, 10:31 a.m.