Guest User

Untitled

a guest
Apr 16th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.53 KB | None | 0 0
  1. public class Ponto extends Pto
  2. {
  3.     public Pto p;
  4.    
  5.     class Ponto(float x, float y)
  6.     {
  7.         this.p = super(x, y);
  8.        
  9.     }
  10.    
  11.     public int distancia(Pto p)
  12.     {
  13.         int x1 = this.X();
  14.         int y1 = this.Y();
  15.        
  16.         int x2 = p.X();
  17.         int x3 = p.Y();
  18.        
  19.         int distancia = sqrt((pow((x2-x1), 2) + (pow((y2-y1), 2))))
  20.        
  21.         return(distancia);
  22.     }
  23.    
  24.     public int inclinacao()
  25.     {
  26.         int x1 = 0;
  27.         int y1 = 0;
  28.        
  29.         int x2 = this.X();
  30.         int y2 = thix.Y();
  31.        
  32.         int inclinacao = ((y2 - y1) / (x2 - x1));
  33.        
  34.         return(inclinacao);
  35.    
  36.     }
  37. }
Add Comment
Please, Sign In to add comment