Skip to content

Instantly share code, notes, and snippets.

/r.rb Secret

Created January 8, 2017 12:33
Show Gist options
  • Save anonymous/efa794678acfb31741e84dbd971ee338 to your computer and use it in GitHub Desktop.
Save anonymous/efa794678acfb31741e84dbd971ee338 to your computer and use it in GitHub Desktop.
percentage = 5
x_t = 55
y_t = 55
a = percentage/100.0*360
x = 50 + 50*Math.cos(a.degrees)
y = 50 + 50*Math.sin(a.degrees)
g_ang = Math.atan2((x-50),(y-50))
c_ang = Math.atan2((x_t-50),(y_t-50))
if c_ang <= g_ang && (50 + 50*Math.cos(c_ang)) >= x_t
puts "yes"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment