I have a problem with my C++ code where Im doing two steps in one with regards to pythagoras.
Im getting the length of a and b at the same time as doing the pythagoras function but my variable always equals 0 even though the X and Y points show up with their respective values.
Unfortunatly due to this when square rooting the resut it procceds with an error as you cannot square root 0.
It looks kinda complicated but this was the neatest I could get it
hypPrevious = (
( *(previousCalcp->getX()) - *(currentCalcp->getX()) )
*
( *(previousCalcp->getX()) - *(currentCalcp->getX()) )
)
+
(
( *(currentCalcp->getY()) - *(previousCalcp->getY()) )
*
( *(currentCalcp->getY()) - *(previousCalcp->getY()) )
);