Why is abs(x)+abs(y) different from sqrt(x*x + y*y)

I was making a Physics Engine in C++ when I noticed that when I replace: float absDistance = sqrt(vectorDistance.x * vectorDistance.x + vectorDistance.y * vectorDistance.y); With: float absDistance = abs(vectorDistance.x) + abs(vectorDistance.y) Different things happen. I’m using the library <cmath> I looked at a lot of stack exchanges but I couldn’t find anyone saying they’re… Read More Why is abs(x)+abs(y) different from sqrt(x*x + y*y)