Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Principal {
- public static void main(String[] args) {
- //tem q transformar em double
- int x1 = 0;
- int y1 = 5;
- int x2 = 10;
- int y2 = 20;
- int D = 0;
- D = Math.sqrt(Math.pow((x2-x1),2) + Math.pow(y2-y1),2));
- System.out.println("Distancia entre Ponto1 e Ponto2: " + D);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement