Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Feb 21st, 2012  |  syntax: None  |  size: 0.78 KB  |  views: 18  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.         int ncenterx = a-centerx;
  2.         int ncentery = b-centery;
  3.         double x2d = (a-centerx) * (a-centerx);
  4.         double y2d = (b-centery) * (b-centery);
  5.         double distance = (Math.sqrt(Math.abs(x2d+y2d)));
  6.         double ny2;
  7.         if(ncentery != 0 )
  8.          {
  9.                 ny2 =ncenterx/ncentery;
  10.          }
  11.         else
  12.          {
  13.                 ny2 = 0;
  14.          }
  15.         double tanx = Math.atan(ny2);
  16.         double anglex = tanx + mc.thePlayer.rotationYaw;
  17.         double rdcosx = Math.cos(anglex);
  18.         double rdsinx = Math.sin(anglex);
  19.         System.out.println(rdcosx + ", " + rdsinx);
  20.         double rcosx = distance * rdcosx;
  21.         double rsinx = distance * rdsinx;
  22.         double aposx = mc.thePlayer.posX+rcosx;
  23.         double aposy = mc.thePlayer.posZ+rsinx;
  24.         int gbcx = (int) aposx;
  25.         int gbcy = (int) aposy;