With the information you gave us, the best advice I can give you is rewriting your code and add a debugging line to check what is going wrong:
int x1 = *(previousCalcp->getX());
int y1 = *(previousCalcp->getY())
int x2 = *(currentCalcp->getX());
int y2 = *(currentCalcp->getY());
int dx = x1 - x2;
int dy = y1 - y2;
hypPrevious = dx*dx + dy*dy;
std::cout << "(" << x1 << "," << y1 << ") and (" << x2 << "," << y2 << ") resulted in " << hypPrevious << std::endl;
Don't forget to change the type int
to whatever you are using in your code.