MCPcopy Create free account
hub / github.com/plotly/plotly.js / findXYatLength

Function findXYatLength

src/plots/polar/helpers.js:96–108  ·  view source on GitHub ↗
(l, m, xp, yp)

Source from the content-addressed store, hash-verified

94// where f(x) = m*x + t + yp
95// and (x0, x1) = (-b +/- del) / (2*a)
96function findXYatLength(l, m, xp, yp) {
97 var t = -m * xp;
98 var a = m * m + 1;
99 var b = 2 * (m * t - xp);
100 var c = t * t + xp * xp - l * l;
101 var del = Math.sqrt(b * b - 4 * a * c);
102 var x0 = (-b + del) / (2 * a);
103 var x1 = (-b - del) / (2 * a);
104 return [
105 [x0, m * x0 + t + yp],
106 [x1, m * x1 + t + yp]
107 ];
108}
109
110function makeRegularPolygon(r, vangles) {
111 var len = vangles.length;

Callers 1

pathCornerForPolygonsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…