through function

Swing through(
  1. double x,
  2. double y,
  3. double th,
  4. double dir,
  5. double r,
  6. double span, {
  7. double at = 0.55,
  8. double sy = 1.0,
  9. double rot = 0.0,
  10. double k = 0.0,
  11. double w = 0.0,
  12. double t0 = 0.0,
  13. double sweep = 0.0,
  14. double hold = 0.0,
  15. double trail = 0.0,
  16. List<int> ramp = const [],
  17. double hot = 0.0,
  18. bool lens = false,
})

A swing on radius r whose arc passes through (x, y) heading along angle th.

Implementation

Swing through(
  double x,
  double y,
  double th,
  double dir,
  double r,
  double span, {
  double at = 0.55,
  double sy = 1.0,
  double rot = 0.0,
  double k = 0.0,
  double w = 0.0,
  double t0 = 0.0,
  double sweep = 0.0,
  double hold = 0.0,
  double trail = 0.0,
  List<int> ramp = const [],
  double hot = 0.0,
  bool lens = false,
}) {
  final a = th - (dir * math.pi) / 2.0;
  return Swing(
    cx: x - math.cos(a) * r,
    cy: y - math.sin(a) * r,
    r: r,
    sy: sy,
    rot: rot,
    a0: a - dir * span * at,
    dir: dir,
    k: k,
    span: span,
    w: w,
    t0: t0,
    sweep: sweep,
    hold: hold,
    trail: trail,
    ramp: ramp,
    hot: hot,
    lens: lens,
  );
}