public Point getAngle1(double [] angles) { double L1 = 325, L2 = 430, L3 = 650; Point i1 = new Point(0, 0); Point i2 = new Point(0, 0); Point O4 = new Point(0, 0); Point O7 = new Point(0, 0); Point O6 = new Point(0, 0); double O4a = 180 - (180 - (angles[2] + 90) + Math.Abs(angles[3])); O4.X = L1 * Math.Cos(CommonMath.Deg2Rad(angles[2] + 90)) - 170; O4.Y = L1 * Math.Sin(CommonMath.Deg2Rad(angles[2] + 90)); O7.X = L2 * Math.Cos(CommonMath.Deg2Rad(O4a)) + O4.X; O7.Y = L2 * Math.Sin(CommonMath.Deg2Rad(O4a)) + O4.Y; O6.X = L1 * Math.Cos(CommonMath.Deg2Rad(angles[4] + 90)) + 170; O6.Y = L1 * Math.Sin(CommonMath.Deg2Rad(angles[4] + 90)); CommonMath.FindCircleCircleIntersections(O7.X, O7.Y, L3, O6.X, O6.Y, L2, out i1, out i2); Point a = new Point(CommonMath.getMagicAngle(O4, L2, L3, i2), CommonMath.getMagicAngle(new Point(170, 0), L1, L2, i2)); return(a); }