Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int ncenterx = a-centerx;
- int ncentery = b-centery;
- double x2d = (a-centerx) * (a-centerx);
- double y2d = (b-centery) * (b-centery);
- double distance = (Math.sqrt(Math.abs(x2d+y2d)));
- double ny2;
- if(ncentery != 0 )
- {
- ny2 =ncenterx/ncentery;
- }
- else
- {
- ny2 = 0;
- }
- double tanx = Math.atan(ny2);
- double anglex = tanx + mc.thePlayer.rotationYaw;
- double rdcosx = Math.cos(anglex);
- double rdsinx = Math.sin(anglex);
- System.out.println(rdcosx + ", " + rdsinx);
- double rcosx = distance * rdcosx;
- double rsinx = distance * rdsinx;
- double aposx = mc.thePlayer.posX+rcosx;
- double aposy = mc.thePlayer.posZ+rsinx;
- int gbcx = (int) aposx;
- int gbcy = (int) aposy;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement