Buscar

Ponto

Esta é uma pré-visualização de arquivo. Entre para ver o arquivo original

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ia_exercicio01;
/**
 *
 * @author marco.silva2
 */
public class Ponto {
 private int A;
 private int B;
 private double distancia;
 private char contem;
 public Ponto() {
 }
 public double hipotenusa(int fimx, int fimy) {
 double cateto1 = Math.abs(fimx - getB());
 double cateto2 = Math.abs(fimy - getA());
 return Math.sqrt(Math.pow(cateto1, 2) + Math.pow(cateto2, 2));
 }
 /**
 * @return the X
 */
 public int getA() {
 return A;
 }
 /**
 * @param X the X to set
 */
 public void setA(int X) {
 this.A = X;
 }
 /**
 * @return the Y
 */
 public int getB() {
 return B;
 }
 /**
 * @param Y the Y to set
 */
 public void setB(int Y) {
 this.B = Y;
 }
 /**
 * @return the distancia
 */
 public double getDistancia() {
 return distancia;
 }
 /**
 * @param distancia the distancia to set
 */
 public void setDistancia(double distancia) {
 this.distancia = distancia;
 }
}

Teste o Premium para desbloquear

Aproveite todos os benefícios por 3 dias sem pagar! 😉
Já tem cadastro?

Outros materiais