How to use the @mathigon/fermat.Angle function in @mathigon/fermat

To help you get started, we’ve selected a few @mathigon/fermat examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mathigon / textbooks / content / polyhedra / functions.ts View on Github external
$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');
  });
github mathigon / textbooks / content / polyhedra / functions.ts View on Github external
$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');
  });
github mathigon / textbooks / content / circles / functions.ts View on Github external
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);
  }
github mathigon / textbooks / content / circles / functions.ts View on Github external
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);
  }
github mathigon / textbooks / content / polyhedra / functions.ts View on Github external
$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');
  });
github mathigon / textbooks / content / chaos / components / pool-table.ts View on Github external
normalAt(p: Point) {
    const a = new Angle(this.f1, p, this.f2);
    return a.bisector;
  }
github mathigon / textbooks / content / polyhedra / functions.ts View on Github external
$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');
  });
github mathigon / textbooks / content / polyhedra / functions.ts View on Github external
$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');
  });