Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
$step.model.watch(s => {
const a1 = new Angle(s.b, s.a, s.d).deg;
const a2 = new Angle(s.c, s.b, s.a).deg;
const a3 = new Angle(s.d, s.c, s.b).deg;
const a4 = new Angle(s.a, s.d, s.c).deg;
overlap[0] = a1 + a2 + a3 + a4 > 361;
const b1 = new Angle(s.f, s.e, s.i).deg;
const b2 = new Angle(s.g, s.f, s.e).deg;
const b3 = new Angle(s.h, s.g, s.f).deg;
const b4 = new Angle(s.i, s.h, s.g).deg;
const b5 = new Angle(s.e, s.i, s.h).deg;
overlap[1] = b1 + b2 + b3 + b4 + b5 >= 541;
if (overlap[0] || overlap[1]) $step.addHint('no-overlap');
});
$step.model.watch(s => {
const a1 = new Angle(s.b, s.a, s.d).deg;
const a2 = new Angle(s.c, s.b, s.a).deg;
const a3 = new Angle(s.d, s.c, s.b).deg;
const a4 = new Angle(s.a, s.d, s.c).deg;
overlap[0] = a1 + a2 + a3 + a4 > 361;
const b1 = new Angle(s.f, s.e, s.i).deg;
const b2 = new Angle(s.g, s.f, s.e).deg;
const b3 = new Angle(s.h, s.g, s.f).deg;
const b4 = new Angle(s.i, s.h, s.g).deg;
const b5 = new Angle(s.e, s.i, s.h).deg;
overlap[1] = b1 + b2 + b3 + b4 + b5 >= 541;
if (overlap[0] || overlap[1]) $step.addHint('no-overlap');
});
function setState(i: number) {
const arc1 = new Angle($step.model.a, center, zero).arc;
const arc2 = new Angle($step.model.b, center, ends[i]).arc;
animate((p) => {
$step.model.a = arc1.at(p);
$step.model.b = arc2.at(p);
}, 600);
}
function setState(i: number) {
const arc1 = new Angle($step.model.a, center, zero).arc;
const arc2 = new Angle($step.model.b, center, ends[i]).arc;
animate((p) => {
$step.model.a = arc1.at(p);
$step.model.b = arc2.at(p);
}, 600);
}
$step.model.watch(s => {
const a1 = new Angle(s.b, s.a, s.d).deg;
const a2 = new Angle(s.c, s.b, s.a).deg;
const a3 = new Angle(s.d, s.c, s.b).deg;
const a4 = new Angle(s.a, s.d, s.c).deg;
overlap[0] = a1 + a2 + a3 + a4 > 361;
const b1 = new Angle(s.f, s.e, s.i).deg;
const b2 = new Angle(s.g, s.f, s.e).deg;
const b3 = new Angle(s.h, s.g, s.f).deg;
const b4 = new Angle(s.i, s.h, s.g).deg;
const b5 = new Angle(s.e, s.i, s.h).deg;
overlap[1] = b1 + b2 + b3 + b4 + b5 >= 541;
if (overlap[0] || overlap[1]) $step.addHint('no-overlap');
});
normalAt(p: Point) {
const a = new Angle(this.f1, p, this.f2);
return a.bisector;
}
$step.model.watch(s => {
const a1 = new Angle(s.b, s.a, s.d).deg;
const a2 = new Angle(s.c, s.b, s.a).deg;
const a3 = new Angle(s.d, s.c, s.b).deg;
const a4 = new Angle(s.a, s.d, s.c).deg;
overlap[0] = a1 + a2 + a3 + a4 > 361;
const b1 = new Angle(s.f, s.e, s.i).deg;
const b2 = new Angle(s.g, s.f, s.e).deg;
const b3 = new Angle(s.h, s.g, s.f).deg;
const b4 = new Angle(s.i, s.h, s.g).deg;
const b5 = new Angle(s.e, s.i, s.h).deg;
overlap[1] = b1 + b2 + b3 + b4 + b5 >= 541;
if (overlap[0] || overlap[1]) $step.addHint('no-overlap');
});
$step.model.watch(s => {
const a1 = new Angle(s.b, s.a, s.d).deg;
const a2 = new Angle(s.c, s.b, s.a).deg;
const a3 = new Angle(s.d, s.c, s.b).deg;
const a4 = new Angle(s.a, s.d, s.c).deg;
overlap[0] = a1 + a2 + a3 + a4 > 361;
const b1 = new Angle(s.f, s.e, s.i).deg;
const b2 = new Angle(s.g, s.f, s.e).deg;
const b3 = new Angle(s.h, s.g, s.f).deg;
const b4 = new Angle(s.i, s.h, s.g).deg;
const b5 = new Angle(s.e, s.i, s.h).deg;
overlap[1] = b1 + b2 + b3 + b4 + b5 >= 541;
if (overlap[0] || overlap[1]) $step.addHint('no-overlap');
});