Created
April 16, 2016 10:48
-
-
Save Cranc/65fd8f5bcf6a151c4885e8249d5833af to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Segment divider (currently at a fixed length) | |
int div; | |
int div_c; | |
float upper_limit; | |
float bottom_limit; | |
if (dy < dx) | |
div_c = Math.abs(dy); | |
else | |
div_c = Math.abs(dx); | |
if (div_c < 10) | |
div_c = 10; | |
div = (int) Math.sqrt(Math.pow(Math.abs(dx),2) + Math.pow(Math.abs(dy),2))/div_c; | |
if(div < 10) | |
div = 10; | |
upper_limit = div * 0.66f; | |
bottom_limit = div * 0.33f; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment