I got the (x,y) center location of two circles and their radius but I need to find their intersection points (marked with red) using JavaScript.
I think the best explanation as far as the math is concerned is found here (Intersection of two circles), but I don't really understand the math so I'm not able to implement it.
For example d = ||P1 - P0|| , what do the || stand for? Does it mean that the resulting number is always a positive?
And also P2 = P0 + a ( P1 - P0 ) / d , aren't the P's here something like (10, 50)? But doing (10,50)+13 in JavaScript gives you 63, so it just ignores the first number, so what's suppose to happen? Should the outcome be (23,63) here or? And also the P1-P0 part or (40,30)-(10,60), how do you express that in JavaScript?
Translated the C function on the site to JavaScript: