MCPcopy Index your code
hub / github.com/microsoft/SandDance / point1

Function point1

docs/app/js/sanddance-app.js:121747–121765  ·  view source on GitHub ↗
(x2, y2, w2)

Source from the content-addressed store, hash-verified

121745function vg_trail() {
121746 var x8, y7, size, defined, context17 = null, ready, x1, y1, r1;
121747 function point1(x2, y2, w2) {
121748 const r2 = w2 / 2;
121749 if (ready) {
121750 var ux = y1 - y2, uy = x2 - x1;
121751 if (ux || uy) {
121752 // get normal vector
121753 var ud = Math.sqrt(ux * ux + uy * uy), rx = (ux /= ud) * r1, ry = (uy /= ud) * r1, t = Math.atan2(uy, ux); // draw segment
121754 context17.moveTo(x1 - rx, y1 - ry);
121755 context17.lineTo(x2 - ux * r2, y2 - uy * r2);
121756 context17.arc(x2, y2, r2, t - Math.PI, t);
121757 context17.lineTo(x1 + rx, y1 + ry);
121758 context17.arc(x1, y1, r1, t, t + Math.PI);
121759 } else context17.arc(x2, y2, r2, 0, Tau);
121760 context17.closePath();
121761 } else ready = 1;
121762 x1 = x2;
121763 y1 = y2;
121764 r1 = r2;
121765 }
121766 function trail1(data) {
121767 var i, n = data.length, d, defined0 = false, buffer;
121768 if (context17 == null) context17 = buffer = (0, _d3Path.path)();

Callers 1

trail1Function · 0.70

Calls 5

visible1Function · 0.70
moveToMethod · 0.45
lineToMethod · 0.45
arcMethod · 0.45
closePathMethod · 0.45

Tested by

no test coverage detected