INNER CODE UNIT · Dart
p2xB
LanarsInc/animated-bottom-navigation-bar-flutter · lib/src/circular_notched_and_cornered_shape.dart:107
double p2xB = ((a * r * r) + n2) / (a * a + b * b);
double p2yA = math.sqrt(r * r - p2xA * p2xA);
double p2yB = math.sqrt(r * r - p2xB * p2xB);
List<Offset> p = List.filled(6, Offset.zero, growable: true);
// p0, p1, and p2 are the control points for segment A.
p[0] = Offset(a - s1, b);
p[1] = Offset(a, b);
double cmp = b < 0 ? -1.0 : 1.0;
p[2] = cmp * p2yA > cmp * p2yB ? Offset(p2xA, p2yA) : Offset(p2xB, p2yB);
// p3, p4, and p5 are the control points for segment B, which is a mirror
// of segment A around the y axis.
p[3] = Offset(-1.0 * p[2].dx, p[2].dy);
p[4] = Offset(-1.0 * p[1].dx, p[1].dy);
p[5] = Offset(-1.0 * p[0].dx, p[0].dy);