Created
August 27, 2011 06:29
-
-
Save brand-it/1175068 to your computer and use it in GitHub Desktop.
This is a basic distance calculation for game. Was testing out how accurate the data that is returned from numbers. Seams to be very good.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Start { | |
public static void main(String args[]) { | |
System.out.println("x, y: " + (7 - 6) + ", " + (3 - 4)); | |
System.out.println((Math.pow((7 - 6), 2) + Math.pow((3 - 4), 2))); | |
System.out.println("x, y: " + (7 - 6) + ", " + (3 - 2)); | |
System.out.println((Math.pow((7 - 6), 2) + Math.pow((3 - 2), 2))); | |
System.out.println("x, y: " + (7 - 8) + ", " + (3 - 4)); | |
System.out.println((Math.pow((7 - 8), 2) + Math.pow((3 - 4), 2))); | |
System.out.println("x, y: " + (7 - 8) + ", " + (3 - 2)); | |
System.out.println((Math.pow((7 - 8), 2) + Math.pow((3 - 2), 2))); | |
System.out.println("x, y: " + (7 - 5) + ", " + (3 - 5)); | |
System.out.println((Math.pow((7 - 5), 2) + Math.pow((3 - 5), 2))); | |
System.out.println("x, y: " + (7 - 6) + ", " + (3 - 2)); | |
System.out.println((Math.pow((7 - 6), 2) + Math.pow((3 - 2), 2))); | |
System.out.println("x, y: " + (7 - 8) + ", " + (3 - 4)); | |
System.out.println((Math.pow((7 - 8), 2) + Math.pow((3 - 4), 2))); | |
System.out.println("x, y: " + (7 - 8) + ", " + (3 - 2)); | |
System.out.println((Math.pow((7 - 8), 2) + Math.pow((3 - 2), 2))); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment