long_turn: Determines whether a point is within a long 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 long 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
long_turn(lag, lead, threshold=100)

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

short_turn, number_passes, narrow_passes

Examples

1
2
3
4
5
long_turn(100, 0) # => FALSE
long_turn(10, 200)  # => TRUE
long_turn(360, 0) # => FALSE
long_turn(0, 180, threshold=178) # => TRUE
 

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