MCPcopy Index your code
hub / github.com/plotly/plotly.js / smith

Function smith

src/plots/smith/helpers.js:11–19  ·  view source on GitHub ↗
(a)

Source from the content-addressed store, hash-verified

9
10// adapted from Mike Bostock's https://observablehq.com/@mbostock/smith-chart
11function smith(a) {
12 var R = a[0];
13 var X = a[1];
14
15 if(!isFinite(R) || !isFinite(X)) return [1, 0];
16
17 var D = (R + 1) * (R + 1) + X * X;
18 return [(R * R + X * X - 1) / D, 2 * X / D];
19}
20
21function transform(subplot, a) {
22 var x = a[0];

Callers 4

plot.jsFile · 0.85
reactanceArcFunction · 0.85
resistanceArcFunction · 0.85
polar.jsFile · 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…