through function
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,
);
}