// http://paulbourke.net/geometry/circlesphere/ Intersection of two circles function vector intersectionTwoCiclesLeft(vector p0, p1; float radius0, radius1) { float d = distance(p0, p1); float a = (radius0 * radius0 - radius1 * radius1 + d * d) / (2*d); float h = sqrt(radius0 * radius0 - a * a); vector p2 = p0 + a * (p1 - p0) / d; // xz return set( p2.x - h*(p1.z - p0.z)/d, p2.y, p2.z + h*(p1.x - p0.x)/d ); }