Good night, I need to do a TAD point implementation, I'm getting to do in Python, but the problem is that it should be implemented in Java and I have no idea how to get started.
import math
class Ponto(object):
def __init__(self, x=0, y=0):
self.x=x
self.y=y
def igual(self, ponto):
return self.x == ponto.x and self.y == ponto.y
def texto(self):
return '('+str(self.x)+', '+str(self.y)+')'
def distancia(self, ponto):
d1=self.x-ponto.x
d2=self.y-ponto.y
return math.sqrt(d1*d1+d2*d2)
def translada(self, dx, dy):
self.x=self.x+dx
self.y=self.y+dy