我需要能够计算2个圆圈之间的交点.我确信总会有2个交叉点.不是1,不是0,不是无限,总是2.这是我想要做的图表:

这是我目前的尝试:
public static List<Vector2> intersect(Vector3 c1, Vector3 c2, float rad1, float rad2)
{
List<Vector2> rLp = new List<Vector2>();
float d = Vector2.Distance(c1, c2);
if (d > (rad1 + rad2))
return rLp;
else if (d == 0 && rad1 == rad2)
return rLp;
else if ((d + Mathf.Min(rad1, rad2)) < Mathf.Max(rad1, rad2))
return rLp;
else
{
float a = (rad1 * rad1 - rad2 * rad2 + d * d) / (2 * d);
float h = Mathf.Sqrt(rad1 * rad1 …Run Code Online (Sandbox Code Playgroud)