Skip to content

Instantly share code, notes, and snippets.

@oganm
Last active April 7, 2020 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oganm/c29b02d3b49ae15941c278b4788bade6 to your computer and use it in GitHub Desktop.
Save oganm/c29b02d3b49ae15941c278b4788bade6 to your computer and use it in GitHub Desktop.
flagCoords
# source https://en.wikipedia.org/wiki/Flag_of_Turkey
# suggested width for narrow images
coverWidth = 590
starOverlap = 2/5-1/3
# approximate and arbitrary
G = coverWidth* (4/3 - starOverlap)
# height and width of big (white) circle
bigR = round(G/2)
# height and width of small (red) circle
smallR = round(2*G/5)
# diameter of circle around the star
starR = (G/4)
# width and height of the star icon
starWidth = round((starR/2)/0.525731)
starHeight = round(starWidth*cos(18*pi/180))
bigSmallDelta = round(G/16)
# x coordinates of objects
bigX = coverWidth/2-bigR
smallX = bigX + bigSmallDelta
starSmallDelta = (2*G/10) - (2*G/5 - G/3) + starHeight/2
starX = round(smallX + starSmallDelta)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment