Skip to content

Instantly share code, notes, and snippets.

@zwpp
Last active August 29, 2015 14:03
Show Gist options
  • Save zwpp/bcf202b9b5f37a045386 to your computer and use it in GitHub Desktop.
Save zwpp/bcf202b9b5f37a045386 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
# encoding: utf-8
include Math
n = 6
a = 0.5
b = 1/sqrt(3)
30.times do
n = 2*n
a = sqrt((1-sqrt(1-a**2))/2)
b = b/(sqrt(1+b**2)+1)
printf("%d\t%.20f\t%.20f\n", n, n*a, n*b)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment