pi = Math.atan(1) * 4 (4..10000).each { |n| theta = 2.0 * pi / n l = Math.sqrt(1 + 1 - 2 * Math.cos(theta)) puts "#{n} #{l * n / 2.0}" }