public void GetECircleFromHCircle() { if (HX == 0f && HY == 0f) { EX = 0f; EY = 0f; ER = HTransform.H2EFromOrigin(HR); return; } float r = Mathf.Sqrt(HX * HX + HY * HY); float nx = HX / r; float ny = HY / r; float d = HTransform.E2HFromOrigin(r); float r1 = HTransform.H2EFromOrigin(d + HR); float r2 = HTransform.H2EFromOrigin(d - HR); EX = 0.5f * (r1 + r2) * nx; EY = 0.5f * (r1 + r2) * ny; ER = 0.5f * (r1 - r2); }
public void GetHCircleFromECircle() { if (EX == 0f && EY == 0f) { HX = 0f; HY = 0f; HR = Mathf.Log((1 + ER) / (1 - ER), 2.718281828459f); return; } float r = Mathf.Sqrt(EX * EX + EY * EY); float nx = EX / r; float ny = EY / r; float d1 = HTransform.E2HFromOrigin(r + ER); float d2 = HTransform.E2HFromOrigin(r - ER); float d = HTransform.H2EFromOrigin(0.5f * (d1 + d2)); HX = d * nx; HY = d * ny; HR = 0.5f * (d1 - d2); }