Advertisement
Bkmz

Untitled

Oct 22nd, 2011
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.62 KB | None | 0 0
  1.       x = (radius*Math::sin(phi+(2*Math::PI*i)/faces)*Math::cos(phi+(2*Math::PI*i)/faces)).round(rnd)
  2.       y = (radius*Math::cos(phi+(2*Math::PI*i)/faces)*Math::sin(phi+(2*Math::PI*i)/faces)).round(rnd)
  3.       z = (radius*Math::cos(phi+(2*Math::PI*i)/faces)).round(rnd)
  4.  
  5.  
  6.       xn = (radius*Math::sin(phi+(2*Math::PI*i.next)/faces)*Math::cos(phi+(2*Math::PI*i.next)/faces)).round(rnd)
  7.       yn = (radius*Math::cos(phi+(2*Math::PI*i.next)/faces)*Math::sin(phi+(2*Math::PI*i.next)/faces)).round(rnd)
  8.       zn = (radius*Math::cos(phi+(2*Math::PI*i.next)/faces)).round(rnd)
  9.  
  10.       push [Point.new(x, y, z), Point.new(xn, yn, zn)]
  11.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement