Description Usage Arguments Value See Also Examples
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.
1 | short_turn(lag, lead, threshold=45)
|
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. |
boolean. 'TRUE' if the difference between directions is greater than 'threshold', 'FALSE' otherwise.
long_turn, number_passes, narrow_passes
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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.