SHARE
TWEET

Untitled

a guest Jul 11th, 2015 223 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ->a{s=Math::PI/18E4
  2. t=1+d=r=c=0
  3. a=a.map{|e|e-a[0]}
  4. 0.upto(36E4){|i|b=a.map{|e|(e/Complex.polar(1,i*s)).rect}.transpose
  5. m,n=b
  6. if n.min>=f=0
  7. l=[m.max-x=m.min,n.max].max
  8. a.each_index{|j|f+=((l-w=n[j])*(x+l-v=m[j])*(x-v)*w)**2}
  9. (1E-9>q=f/l**8)&&(c>0&&(i-d)%9E4%89E3>1E3?c=9E9:0;c+=1;d=i)
  10. q<t&&r=i&&t=q;end}
  11. c<101&&a[1]?c<1?'impossible':r%9E4/1.0E3:'unknown'}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top