I'm writing a 2d game and have a question regarding the use of bounding spheres.
I'm kind of OK with the math, but I'm confused about one thing.
To work out the distance between the 2 centre points I've read that I need to do something like this:
XDistance = Sphere2_center - Sphere1_center.
And then some other calculations etc...
So if me Sphere1_center X is say, 100 pixels and my Sphere2_center is say 200, then the XDistance will equal to 100 which is fine, however, what confuses me is this. What happens if the positions of the spheres are reversed, then the 'code' would result in -100. This surely will affect the remainder of the calculations?
Not sure if I've got the whole thing wrong but I would be grateful if someone could advise. Many thanks