Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function drawAngle(angle: Angle, options: SVGDrawingOptions = {}) {
let a = angle.a;
const b = angle.b;
let c = angle.c;
const size = options.size || angleSize(angle, options);
const ba = Point.difference(a, b).unitVector;
const bc = Point.difference(c, b).unitVector;
a = Point.sum(b, ba.scale(size));
c = Point.sum(b, bc.scale(size));
let p = options.fill ? `M${b.x},${b.y}L` : 'M';
if (angle.isRight && !options.round) {
const d = Point.sum(a, bc.scale(size));
p += `${a.x},${a.y}L${d.x},${d.y}L${c.x},${c.y}`;
} else {
p += drawArc(a, b, c);
}
if (options.fill) p += 'Z';
return p;
}
let a = angle.a;
const b = angle.b;
let c = angle.c;
const size = options.size || angleSize(angle, options);
const ba = Point.difference(a, b).unitVector;
const bc = Point.difference(c, b).unitVector;
a = Point.sum(b, ba.scale(size));
c = Point.sum(b, bc.scale(size));
let p = options.fill ? `M${b.x},${b.y}L` : 'M';
if (angle.isRight && !options.round) {
const d = Point.sum(a, bc.scale(size));
p += `${a.x},${a.y}L${d.x},${d.y}L${c.x},${c.y}`;
} else {
p += drawArc(a, b, c);
}
if (options.fill) p += 'Z';
return p;
}
function drawAngle(angle: Angle, options: SVGDrawingOptions = {}) {
let a = angle.a;
const b = angle.b;
let c = angle.c;
const size = options.size || angleSize(angle, options);
const ba = Point.difference(a, b).unitVector;
const bc = Point.difference(c, b).unitVector;
a = Point.sum(b, ba.scale(size));
c = Point.sum(b, bc.scale(size));
let p = options.fill ? `M${b.x},${b.y}L` : 'M';
if (angle.isRight && !options.round) {
const d = Point.sum(a, bc.scale(size));
p += `${a.x},${a.y}L${d.x},${d.y}L${c.x},${c.y}`;
} else {
p += drawArc(a, b, c);
}
if (options.fill) p += 'Z';
return p;
}