Skip to content

Instantly share code, notes, and snippets.

@fthiery
Last active July 17, 2021 10:28
Show Gist options
  • Save fthiery/d36a5301ba4fc0d2d295d9695f96e2e6 to your computer and use it in GitHub Desktop.
Save fthiery/d36a5301ba4fc0d2d295d9695f96e2e6 to your computer and use it in GitHub Desktop.
Python script for calculating sail and find size for windsurf
#!/usr/bin/env python3
# ripoff of https://github.com/RoryMearns/Windsurf_Calculator/blob/master/javascript/windcalc.js
weight_kg = 70
sail_alpha = 1.34
fin_alpha = 4.9383
fin_extra = 3.0988
def get_sail(wind):
weight_factor = sail_alpha * weight_kg
sail_size = weight_factor / wind
return sail_size
def get_fin(wind):
fin_factor = sail_alpha * weight_kg
fin_size = int(fin_alpha * fin_factor / wind + fin_extra)
return fin_size
print(f'Freerider weight: {weight_kg} kg')
for wind in [10, 12, 13, 14, 15, 20, 25]:
sail_size = get_sail(wind)
fin_size = get_fin(wind)
print(f'For {wind} knots, {sail_size:.1f} m2 sail, {fin_size} cm fin')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment