Created
October 6, 2015 19:27
-
-
Save TrevorHinesley/63734256dd2b42c8ad91 to your computer and use it in GitHub Desktop.
helmet math
This file contains hidden or 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
| def helmet_distance_from_the_left team, index | |
| width_of_largest_sideline = 850 | |
| midfield = width_of_largest_sideline / 2 | |
| helmet_starting_line_offset = index*3.8 | |
| distance_from_far_left_edge_to_one_yard_line = 130 | |
| distance_from_left = distance_from_far_left_edge_to_one_yard_line + | |
| ((team.num_of_hashtag_shares / team.offset) / days_until_campaign_ends) | |
| if distance_from_left >= midfield | |
| distance_from_midfield_to_current_position = distance_from_left - midfield | |
| divisor = midfield / distance_from_midfield_to_current_position | |
| else | |
| distance_from_midfield_to_current_position = midfield - distance_from_left | |
| divisor = midfield / distance_from_midfield_to_current_position | |
| end | |
| helmet_starting_line_offset = helmet_starting_line_offset / divisor | |
| distance_from_left + helmet_starting_line_offset | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment