smithkit 0.1.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +291 -42
- package/dist/lib/MarkerMeasurements.d.ts +6 -0
- package/dist/lib/MarkerMeasurements.js +22 -0
- package/dist/lib/Smith.d.ts +18 -35
- package/dist/lib/Smith.js +107 -275
- package/dist/lib/SmithFormatter.d.ts +10 -0
- package/dist/lib/SmithFormatter.js +19 -0
- package/dist/lib/appearance/SvgTheme.d.ts +6 -0
- package/dist/lib/appearance/SvgTheme.js +21 -0
- package/dist/lib/appearance/Theme.d.ts +8 -0
- package/dist/lib/appearance/Theme.js +120 -0
- package/dist/lib/appearance/types.d.ts +55 -0
- package/dist/lib/grid/CircleLayerControl.d.ts +15 -0
- package/dist/lib/grid/CircleLayerControl.js +40 -0
- package/dist/lib/{draw → grid}/ConstCircles.d.ts +4 -9
- package/dist/lib/{draw → grid}/ConstCircles.js +8 -22
- package/dist/lib/{draw → grid}/ConstQCircles.d.ts +2 -2
- package/dist/lib/{draw → grid}/ConstQCircles.js +4 -4
- package/dist/lib/{draw → grid}/ConstSwrCircles.d.ts +2 -2
- package/dist/lib/{draw → grid}/ConstSwrCircles.js +4 -4
- package/dist/lib/grid/GridDefinitions.d.ts +18 -0
- package/dist/lib/grid/GridDefinitions.js +167 -0
- package/dist/lib/grid/GridGeometry.d.ts +26 -0
- package/dist/lib/grid/GridGeometry.js +58 -0
- package/dist/lib/grid/GridLabels.d.ts +8 -0
- package/dist/lib/grid/GridLabels.js +45 -0
- package/dist/lib/grid/GridLayerControl.d.ts +13 -0
- package/dist/lib/grid/GridLayerControl.js +48 -0
- package/dist/lib/grid/LayerControl.d.ts +6 -0
- package/dist/lib/grid/LayerControl.js +16 -0
- package/dist/lib/grid/SmithGridLayer.d.ts +26 -0
- package/dist/lib/grid/SmithGridLayer.js +95 -0
- package/dist/lib/grid/types.d.ts +1 -1
- package/dist/lib/index.d.ts +11 -11
- package/dist/lib/index.js +5 -7
- package/dist/lib/{draw → interaction}/SmithCursor.d.ts +3 -20
- package/dist/lib/{draw → interaction}/SmithCursor.js +12 -20
- package/dist/lib/io/Touchstone.d.ts +10 -0
- package/dist/lib/io/Touchstone.js +75 -0
- package/dist/lib/layers.d.ts +7 -9
- package/dist/lib/layers.js +1 -73
- package/dist/lib/{complex → math}/Complex.d.ts +1 -0
- package/dist/lib/{complex → math}/Complex.js +1 -1
- package/dist/lib/math/geometry.d.ts +14 -0
- package/dist/lib/measurements.d.ts +2 -4
- package/dist/lib/measurements.js +1 -19
- package/dist/lib/rendering/SvgChartRenderer.d.ts +66 -0
- package/dist/lib/rendering/SvgChartRenderer.js +342 -0
- package/dist/lib/rf/RfCalculations.d.ts +65 -0
- package/dist/lib/rf/RfCalculations.js +161 -0
- package/dist/lib/{SmithConstantCircle.d.ts → rf/SmithConstantCircle.d.ts} +2 -3
- package/dist/lib/{SmithConstantCircle.js → rf/SmithConstantCircle.js} +3 -4
- package/dist/lib/scales/PeripheralScaleDefinitions.d.ts +16 -0
- package/dist/lib/scales/PeripheralScaleDefinitions.js +54 -0
- package/dist/lib/scales/RadialScaleDefinitions.d.ts +15 -0
- package/dist/lib/scales/RadialScaleDefinitions.js +112 -0
- package/dist/lib/scales/SmithPeripheralScales.d.ts +4 -2
- package/dist/lib/scales/SmithPeripheralScales.js +55 -35
- package/dist/lib/scales/SmithScales.d.ts +11 -2
- package/dist/lib/scales/SmithScales.js +78 -38
- package/dist/lib/svg/ImageExporter.d.ts +18 -0
- package/dist/lib/svg/ImageExporter.js +211 -0
- package/dist/lib/svg/LabelLayout.d.ts +17 -0
- package/dist/lib/svg/LabelLayout.js +145 -0
- package/dist/lib/svg/MarkerLegend.d.ts +12 -0
- package/dist/lib/svg/MarkerLegend.js +63 -0
- package/dist/lib/{draw → svg}/SmithArc.d.ts +1 -1
- package/dist/lib/{draw → svg}/SmithCircle.d.ts +1 -1
- package/dist/lib/{draw → svg}/SmithLine.d.ts +1 -1
- package/dist/lib/{draw → svg}/SmithScaler.d.ts +1 -4
- package/dist/lib/{draw → svg}/SmithText.d.ts +1 -1
- package/dist/lib/svg/SvgExporter.d.ts +19 -0
- package/dist/lib/svg/SvgExporter.js +182 -0
- package/dist/lib/svg/export.d.ts +36 -0
- package/dist/lib/{draw → traces}/SmithData.d.ts +24 -35
- package/dist/lib/traces/SmithData.js +195 -0
- package/dist/lib/{draw → traces}/SmithMarker.d.ts +14 -3
- package/dist/lib/traces/SmithMarker.js +240 -0
- package/dist/lib/traces/TraceModel.d.ts +31 -0
- package/dist/lib/traces/TraceModel.js +123 -0
- package/dist/lib/traces/TraceRenderer.d.ts +33 -0
- package/dist/lib/traces/TraceRenderer.js +152 -0
- package/package.json +4 -1
- package/dist/lib/SmithArcsDefs.d.ts +0 -10
- package/dist/lib/SmithArcsDefs.js +0 -10
- package/dist/lib/components.d.ts +0 -14
- package/dist/lib/components.js +0 -26
- package/dist/lib/draw/SmithData.js +0 -366
- package/dist/lib/draw/SmithGridLayer.d.ts +0 -19
- package/dist/lib/draw/SmithGridLayer.js +0 -48
- package/dist/lib/draw/SmithMarker.js +0 -122
- package/dist/lib/formatting.d.ts +0 -7
- package/dist/lib/formatting.js +0 -16
- package/dist/lib/grid/definitions.d.ts +0 -3
- package/dist/lib/grid/definitions.js +0 -123
- package/dist/lib/grid/geometry.d.ts +0 -20
- package/dist/lib/grid/geometry.js +0 -55
- package/dist/lib/grid/labels.d.ts +0 -3
- package/dist/lib/grid/labels.js +0 -41
- package/dist/lib/io/touchstone.d.ts +0 -7
- package/dist/lib/io/touchstone.js +0 -72
- package/dist/lib/math/complexRatio.d.ts +0 -3
- package/dist/lib/math/complexRatio.js +0 -30
- package/dist/lib/renormalization.d.ts +0 -10
- package/dist/lib/renormalization.js +0 -62
- package/dist/lib/rf.d.ts +0 -35
- package/dist/lib/rf.js +0 -74
- package/dist/lib/scales/peripheralScales.d.ts +0 -12
- package/dist/lib/scales/peripheralScales.js +0 -49
- package/dist/lib/scales/radialScales.d.ts +0 -12
- package/dist/lib/scales/radialScales.js +0 -109
- package/dist/lib/shapes/Arc.d.ts +0 -6
- package/dist/lib/shapes/Circle.d.ts +0 -5
- package/dist/lib/shapes/Line.d.ts +0 -5
- package/dist/lib/shapes/Point.d.ts +0 -1
- package/dist/lib/shapes/Point.js +0 -1
- /package/dist/lib/{draw/SmithDrawOptions.js → appearance/types.js} +0 -0
- /package/dist/lib/{draw → grid}/ConstConductance.d.ts +0 -0
- /package/dist/lib/{draw → grid}/ConstConductance.js +0 -0
- /package/dist/lib/{draw → grid}/ConstReactance.d.ts +0 -0
- /package/dist/lib/{draw → grid}/ConstReactance.js +0 -0
- /package/dist/lib/{draw → grid}/ConstResistance.d.ts +0 -0
- /package/dist/lib/{draw → grid}/ConstResistance.js +0 -0
- /package/dist/lib/{draw → grid}/ConstSusceptance.d.ts +0 -0
- /package/dist/lib/{draw → grid}/ConstSusceptance.js +0 -0
- /package/dist/lib/{arcs → grid}/Tick.d.ts +0 -0
- /package/dist/lib/{arcs → grid}/Tick.js +0 -0
- /package/dist/lib/{draw → interaction}/MouseGesture.d.ts +0 -0
- /package/dist/lib/{draw → interaction}/MouseGesture.js +0 -0
- /package/dist/lib/{shapes/Arc.js → math/geometry.js} +0 -0
- /package/dist/lib/{draw → svg}/SmithArc.js +0 -0
- /package/dist/lib/{draw → svg}/SmithCircle.js +0 -0
- /package/dist/lib/{draw → svg}/SmithDrawOptions.d.ts +0 -0
- /package/dist/lib/{shapes/Circle.js → svg/SmithDrawOptions.js} +0 -0
- /package/dist/lib/{draw → svg}/SmithGroup.d.ts +0 -0
- /package/dist/lib/{draw → svg}/SmithGroup.js +0 -0
- /package/dist/lib/{draw → svg}/SmithLine.js +0 -0
- /package/dist/lib/{draw → svg}/SmithPath.d.ts +0 -0
- /package/dist/lib/{draw → svg}/SmithPath.js +0 -0
- /package/dist/lib/{draw → svg}/SmithScaler.js +0 -0
- /package/dist/lib/{draw → svg}/SmithShape.d.ts +0 -0
- /package/dist/lib/{draw → svg}/SmithShape.js +0 -0
- /package/dist/lib/{draw → svg}/SmithSvg.d.ts +0 -0
- /package/dist/lib/{draw → svg}/SmithSvg.js +0 -0
- /package/dist/lib/{draw → svg}/SmithText.js +0 -0
- /package/dist/lib/{shapes/Line.js → svg/export.js} +0 -0
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
function resistanceArcs(bands) {
|
|
2
|
-
return bands.flatMap(([values, from, to, largeArc]) => values.map((value) => [
|
|
3
|
-
value,
|
|
4
|
-
[
|
|
5
|
-
[from, from < 0 ? 1 : 0],
|
|
6
|
-
[to, to < 0 ? 1 : 0],
|
|
7
|
-
],
|
|
8
|
-
[largeArc, from > to],
|
|
9
|
-
]));
|
|
10
|
-
}
|
|
11
|
-
function reactanceArcs(bands) {
|
|
12
|
-
return bands.flatMap(([values, outer, inner]) => values.flatMap((value) => [
|
|
13
|
-
[
|
|
14
|
-
value,
|
|
15
|
-
[
|
|
16
|
-
[outer, 1],
|
|
17
|
-
[inner, 1],
|
|
18
|
-
],
|
|
19
|
-
[false, false],
|
|
20
|
-
],
|
|
21
|
-
[
|
|
22
|
-
-value,
|
|
23
|
-
[
|
|
24
|
-
[outer, 0],
|
|
25
|
-
[inner, 0],
|
|
26
|
-
],
|
|
27
|
-
[false, true],
|
|
28
|
-
],
|
|
29
|
-
]));
|
|
30
|
-
}
|
|
31
|
-
const resistanceMajor = [
|
|
32
|
-
[[0.05, 0.15], 0.2, -0.2, false],
|
|
33
|
-
[[0.1, 0.3, 0.5, 0.7, 0.9], 2, -2, true],
|
|
34
|
-
[[0.2, 0.4, 0.6, 0.8, 1.2, 1.4, 1.6, 1.8], 5, -5, true],
|
|
35
|
-
[[1, 3, 5], 10, -10, true],
|
|
36
|
-
[[2, 4], 20, -20, true],
|
|
37
|
-
[[20], 50, -50, true],
|
|
38
|
-
];
|
|
39
|
-
const resistanceMinor = [
|
|
40
|
-
[[0.02, 0.04, 0.06, 0.08, 0.12, 0.14, 0.16, 0.18], 0.2, 0.5, false],
|
|
41
|
-
[[0.02, 0.04, 0.06, 0.08, 0.12, 0.14, 0.16, 0.18], -0.2, -0.5, false],
|
|
42
|
-
[[0.05, 0.15, 0.25, 0.35, 0.45], 0.5, 1, false],
|
|
43
|
-
[[0.05, 0.15, 0.25, 0.35, 0.45], -0.5, -1, false],
|
|
44
|
-
[
|
|
45
|
-
[
|
|
46
|
-
0.01, 0.02, 0.03, 0.04, 0.06, 0.07, 0.08, 0.09, 0.11, 0.12, 0.13, 0.14, 0.16, 0.17, 0.18,
|
|
47
|
-
0.19,
|
|
48
|
-
],
|
|
49
|
-
0.2,
|
|
50
|
-
-0.2,
|
|
51
|
-
false,
|
|
52
|
-
],
|
|
53
|
-
[[0.22, 0.24, 0.26, 0.28, 0.32, 0.34, 0.36, 0.38, 0.42, 0.44, 0.46, 0.48], 0.5, -0.5, false],
|
|
54
|
-
[[0.55, 0.65, 0.75, 0.85, 0.95], 2, -2, true],
|
|
55
|
-
[[1.1, 1.3, 1.5, 1.7, 1.9], 2, -2, false],
|
|
56
|
-
[[2.2, 2.4, 2.6, 2.8, 3.2, 3.4, 3.6, 3.8], 5, -5, true],
|
|
57
|
-
[[4.2, 4.4, 4.6, 4.8], 5, -5, false],
|
|
58
|
-
[[6, 8, 12, 14, 16, 18], 20, -20, true],
|
|
59
|
-
[[7, 9], 10, -10, true],
|
|
60
|
-
[[30, 40], 50, -50, true],
|
|
61
|
-
];
|
|
62
|
-
const reactanceMajor = [
|
|
63
|
-
[[0.05, 0.15], 0.2, 0],
|
|
64
|
-
[[0.1, 0.3, 0.5, 0.7, 0.9], 2, 0],
|
|
65
|
-
[[0.2, 0.4, 0.6, 0.8, 1.2, 1.4, 1.6, 1.8], 5, 0],
|
|
66
|
-
[[1, 3, 5], 10, 0],
|
|
67
|
-
[[2, 4, 10], 20, 0],
|
|
68
|
-
[[20], 50, 0],
|
|
69
|
-
];
|
|
70
|
-
const reactanceMinor = [
|
|
71
|
-
[
|
|
72
|
-
[
|
|
73
|
-
0.01, 0.02, 0.03, 0.04, 0.06, 0.07, 0.08, 0.09, 0.11, 0.12, 0.13, 0.14, 0.16, 0.17, 0.18,
|
|
74
|
-
0.19,
|
|
75
|
-
],
|
|
76
|
-
0.2,
|
|
77
|
-
0,
|
|
78
|
-
],
|
|
79
|
-
[[0.02, 0.04, 0.06, 0.08, 0.12, 0.14, 0.16, 0.18], 0.5, 0.2],
|
|
80
|
-
[[0.22, 0.24, 0.26, 0.28, 0.32, 0.34, 0.36, 0.38, 0.42, 0.44, 0.46, 0.48], 0.5, 0],
|
|
81
|
-
[[0.05, 0.15, 0.25, 0.35, 0.45], 1, 0.5],
|
|
82
|
-
[[0.55, 0.65, 0.75, 0.85, 0.95], 1, 0],
|
|
83
|
-
[[1.1, 1.3, 1.5, 1.7, 1.9], 2, 0],
|
|
84
|
-
[[2.2, 2.4, 2.6, 2.8, 3.2, 3.4, 3.6, 3.8, 4.2, 4.4, 4.6, 4.8], 5, 0],
|
|
85
|
-
[[6, 8, 14, 16, 18], 20, 0],
|
|
86
|
-
[[7, 9], 10, 0],
|
|
87
|
-
[[12, 30, 40], 50, 0],
|
|
88
|
-
];
|
|
89
|
-
/** Build fresh definitions so callers cannot mutate another chart's grid. */
|
|
90
|
-
export function createGridDefinitions() {
|
|
91
|
-
return {
|
|
92
|
-
resistance: {
|
|
93
|
-
major: { lines: [], circles: [10, 50], arcs: resistanceArcs(resistanceMajor) },
|
|
94
|
-
minor: { lines: [], circles: [], arcs: resistanceArcs(resistanceMinor) },
|
|
95
|
-
},
|
|
96
|
-
reactance: {
|
|
97
|
-
major: {
|
|
98
|
-
lines: [{ p1: [-1, 0], p2: [1, 0] }],
|
|
99
|
-
circles: [],
|
|
100
|
-
arcs: [
|
|
101
|
-
...reactanceArcs(reactanceMajor),
|
|
102
|
-
[
|
|
103
|
-
50,
|
|
104
|
-
[
|
|
105
|
-
[0, 0],
|
|
106
|
-
[0, 1],
|
|
107
|
-
],
|
|
108
|
-
[false, false],
|
|
109
|
-
],
|
|
110
|
-
[
|
|
111
|
-
-50,
|
|
112
|
-
[
|
|
113
|
-
[0, 1],
|
|
114
|
-
[0, 0],
|
|
115
|
-
],
|
|
116
|
-
[false, true],
|
|
117
|
-
],
|
|
118
|
-
],
|
|
119
|
-
},
|
|
120
|
-
minor: { lines: [], circles: [], arcs: reactanceArcs(reactanceMinor) },
|
|
121
|
-
},
|
|
122
|
-
};
|
|
123
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { TickDefRequired } from '../arcs/Tick.js';
|
|
2
|
-
import type { SmithTicksShapes } from './types.js';
|
|
3
|
-
import type { Point } from '../shapes/Point.js';
|
|
4
|
-
export type GridKind = 'resistance' | 'reactance' | 'conductance' | 'susceptance';
|
|
5
|
-
export type GridArc = [Point, Point, number, boolean, boolean];
|
|
6
|
-
/** Normalized geometry only: no DOM, D3, or pixel coordinates. */
|
|
7
|
-
export declare function gridGeometry(kind: GridKind, data: SmithTicksShapes): {
|
|
8
|
-
lines: import("../shapes/Line.js").Line[];
|
|
9
|
-
circles: import("../shapes/Circle.js").Circle[];
|
|
10
|
-
arcs: GridArc[];
|
|
11
|
-
};
|
|
12
|
-
export declare function gridLabel(kind: GridKind, definition: TickDefRequired): {
|
|
13
|
-
point: [number, number];
|
|
14
|
-
text: string;
|
|
15
|
-
rotate: number;
|
|
16
|
-
dx: number;
|
|
17
|
-
dy: number;
|
|
18
|
-
textAnchor: string;
|
|
19
|
-
dominantBaseline: string;
|
|
20
|
-
};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { SmithConstantCircle } from '../SmithConstantCircle.js';
|
|
2
|
-
import { Complex } from '../complex/Complex.js';
|
|
3
|
-
const calcs = new SmithConstantCircle();
|
|
4
|
-
const circles = {
|
|
5
|
-
resistance: (value) => calcs.resistanceCircle(value),
|
|
6
|
-
reactance: (value) => calcs.reactanceCircle(value),
|
|
7
|
-
conductance: (value) => calcs.conductanceCircle(value),
|
|
8
|
-
susceptance: (value) => calcs.susceptanceCircle(value),
|
|
9
|
-
};
|
|
10
|
-
const clipping = {
|
|
11
|
-
resistance: 'reactance',
|
|
12
|
-
reactance: 'resistance',
|
|
13
|
-
conductance: 'susceptance',
|
|
14
|
-
susceptance: 'conductance',
|
|
15
|
-
};
|
|
16
|
-
/** Normalized geometry only: no DOM, D3, or pixel coordinates. */
|
|
17
|
-
export function gridGeometry(kind, data) {
|
|
18
|
-
const circle = circles[kind];
|
|
19
|
-
const clip = circles[clipping[kind]];
|
|
20
|
-
return {
|
|
21
|
-
lines: data.lines,
|
|
22
|
-
circles: data.circles.map(circle),
|
|
23
|
-
arcs: data.arcs.map(([value, limits, options]) => {
|
|
24
|
-
const c = circle(value);
|
|
25
|
-
const [a, b] = limits.map(([limit, index]) => calcs.circleCircleIntersection(c, clip(limit))[index]);
|
|
26
|
-
return [a, b, c.r, options[0], options[1]];
|
|
27
|
-
}),
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
export function gridLabel(kind, definition) {
|
|
31
|
-
const { point, transform, dp, textAnchor, dominantBaseline } = definition;
|
|
32
|
-
const admittance = kind === 'conductance' || kind === 'susceptance';
|
|
33
|
-
const real = kind === 'resistance' || kind === 'conductance';
|
|
34
|
-
const rc = admittance
|
|
35
|
-
? calcs.admittanceToRflCoeff(Complex.from(point.r, point.i))
|
|
36
|
-
: calcs.impedanceToRflCoeff(Complex.from(point.r, point.i));
|
|
37
|
-
if (!rc) {
|
|
38
|
-
throw new Error('Invalid grid label coordinates.');
|
|
39
|
-
}
|
|
40
|
-
const value = real ? point.r : point.i;
|
|
41
|
-
const circle = circles[kind](value);
|
|
42
|
-
let rotate = -calcs.tangentToCircleAngle(circle, rc.toVector()) + transform.rotate;
|
|
43
|
-
if (admittance && rotate !== 90) {
|
|
44
|
-
rotate += 180;
|
|
45
|
-
}
|
|
46
|
-
return {
|
|
47
|
-
point: rc.toVector(),
|
|
48
|
-
text: value.toFixed(dp),
|
|
49
|
-
rotate,
|
|
50
|
-
dx: transform.dx,
|
|
51
|
-
dy: transform.dy,
|
|
52
|
-
textAnchor,
|
|
53
|
-
dominantBaseline,
|
|
54
|
-
};
|
|
55
|
-
}
|
package/dist/lib/grid/labels.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { Tick } from '../arcs/Tick.js';
|
|
2
|
-
const values = [
|
|
3
|
-
0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.2, 1.4, 1.6, 1.8, 2, 3, 4, 5, 10, 20, 50,
|
|
4
|
-
];
|
|
5
|
-
const interiorValues = [0.2, 0.4, 0.6, 0.8, 1];
|
|
6
|
-
export function resistanceLabels() {
|
|
7
|
-
const axis = [0, ...values].map((r) => new Tick({
|
|
8
|
-
point: { r, i: 0 },
|
|
9
|
-
dp: r === 0 || r >= 10 ? 0 : 1,
|
|
10
|
-
transform: { dx: 0.005, dy: r === 0 ? 0.005 : -0.005 },
|
|
11
|
-
dominantBaseline: r === 0 ? 'hanging' : 'baseline',
|
|
12
|
-
}));
|
|
13
|
-
const interior = [1, -1].flatMap((i) => [...interiorValues].reverse().map((r) => new Tick({
|
|
14
|
-
point: { r, i },
|
|
15
|
-
dp: 1,
|
|
16
|
-
transform: { dx: i * 0.005, dy: -0.005, rotate: i < 0 ? 180 : 0 },
|
|
17
|
-
textAnchor: i < 0 ? 'end' : 'start',
|
|
18
|
-
})));
|
|
19
|
-
return [...axis, ...interior];
|
|
20
|
-
}
|
|
21
|
-
export function reactanceLabels() {
|
|
22
|
-
return [1, -1].flatMap((sign) => [
|
|
23
|
-
...interiorValues.map((i) => ({ r: 1, i: sign * i })),
|
|
24
|
-
...values.map((i) => ({ r: 0, i: sign * i })),
|
|
25
|
-
].map((point) => new Tick({
|
|
26
|
-
point,
|
|
27
|
-
dp: Math.abs(point.i) >= 10 ? 0 : 1,
|
|
28
|
-
transform: {
|
|
29
|
-
dx: -sign * 0.005,
|
|
30
|
-
dy: -0.005,
|
|
31
|
-
rotate: sign > 0
|
|
32
|
-
? point.r === 1 || point.i < 1
|
|
33
|
-
? 180
|
|
34
|
-
: 0
|
|
35
|
-
: point.r === 0 && point.i < -1
|
|
36
|
-
? 180
|
|
37
|
-
: 0,
|
|
38
|
-
},
|
|
39
|
-
textAnchor: sign > 0 ? 'end' : 'start',
|
|
40
|
-
})));
|
|
41
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { TraceSamples } from '../samples.js';
|
|
2
|
-
export interface TouchstoneData {
|
|
3
|
-
samples: TraceSamples;
|
|
4
|
-
referenceImpedanceOhms: number;
|
|
5
|
-
}
|
|
6
|
-
/** Read one-port Touchstone 1.x data; frequencies in the result are always Hz. */
|
|
7
|
-
export declare function parseTouchstone(text: string): TouchstoneData;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/** Read one-port Touchstone 1.x data; frequencies in the result are always Hz. */
|
|
2
|
-
export function parseTouchstone(text) {
|
|
3
|
-
const units = { HZ: 1, KHZ: 1e3, MHZ: 1e6, GHZ: 1e9 };
|
|
4
|
-
let frequencyScale = 1e9;
|
|
5
|
-
let format = 'MA';
|
|
6
|
-
let referenceImpedanceOhms = 50;
|
|
7
|
-
let optionsSeen = false;
|
|
8
|
-
const samples = [];
|
|
9
|
-
for (const [index, raw] of text
|
|
10
|
-
.replace(/^\uFEFF/, '')
|
|
11
|
-
.split(/\r?\n/)
|
|
12
|
-
.entries()) {
|
|
13
|
-
const line = raw.split('!')[0].trim();
|
|
14
|
-
if (!line) {
|
|
15
|
-
continue;
|
|
16
|
-
}
|
|
17
|
-
const fail = (message) => {
|
|
18
|
-
throw new Error(`Line ${index + 1}: ${message}`);
|
|
19
|
-
};
|
|
20
|
-
if (line.startsWith('[')) {
|
|
21
|
-
fail('Only Touchstone 1.x one-port files (.s1p) are supported.');
|
|
22
|
-
}
|
|
23
|
-
if (line.startsWith('#')) {
|
|
24
|
-
if (optionsSeen || samples.length) {
|
|
25
|
-
fail('The option line must appear once, before the data.');
|
|
26
|
-
}
|
|
27
|
-
optionsSeen = true;
|
|
28
|
-
const options = line.slice(1).trim().toUpperCase().split(/\s+/).filter(Boolean);
|
|
29
|
-
if (!options.length) {
|
|
30
|
-
continue;
|
|
31
|
-
}
|
|
32
|
-
const [unit = 'GHZ', parameter = 'S', representation = 'MA', r = 'R', impedance = '50'] = options;
|
|
33
|
-
if (!(unit in units) ||
|
|
34
|
-
parameter !== 'S' ||
|
|
35
|
-
!['RI', 'MA', 'DB'].includes(representation) ||
|
|
36
|
-
r !== 'R' ||
|
|
37
|
-
options.length > 5) {
|
|
38
|
-
fail('Expected: # Hz|kHz|MHz|GHz S RI|MA|DB R impedance.');
|
|
39
|
-
}
|
|
40
|
-
frequencyScale = units[unit];
|
|
41
|
-
format = representation;
|
|
42
|
-
referenceImpedanceOhms = Number(impedance);
|
|
43
|
-
if (!Number.isFinite(referenceImpedanceOhms) || referenceImpedanceOhms <= 0) {
|
|
44
|
-
fail('Reference impedance must be positive.');
|
|
45
|
-
}
|
|
46
|
-
continue;
|
|
47
|
-
}
|
|
48
|
-
const fields = line.split(/\s+/).map(Number);
|
|
49
|
-
if (fields.length !== 3 || !fields.every(Number.isFinite)) {
|
|
50
|
-
fail('Expected frequency and two finite S11 components.');
|
|
51
|
-
}
|
|
52
|
-
const [frequency, a, b] = fields;
|
|
53
|
-
const frequencyHz = frequency * frequencyScale;
|
|
54
|
-
if (frequencyHz < 0 || !Number.isFinite(frequencyHz)) {
|
|
55
|
-
fail('Frequency must be finite and non-negative.');
|
|
56
|
-
}
|
|
57
|
-
if (format === 'MA' && a < 0) {
|
|
58
|
-
fail('Magnitude must be non-negative.');
|
|
59
|
-
}
|
|
60
|
-
const magnitude = format === 'DB' ? 10 ** (a / 20) : a;
|
|
61
|
-
const radians = (b * Math.PI) / 180;
|
|
62
|
-
const reflectionCoefficient = format === 'RI' ? [a, b] : [magnitude * Math.cos(radians), magnitude * Math.sin(radians)];
|
|
63
|
-
if (!reflectionCoefficient.every(Number.isFinite)) {
|
|
64
|
-
fail('S11 is outside the supported numeric range.');
|
|
65
|
-
}
|
|
66
|
-
samples.push({ frequencyHz, reflectionCoefficient });
|
|
67
|
-
}
|
|
68
|
-
if (!samples.length) {
|
|
69
|
-
throw new Error('The file contains no S11 samples.');
|
|
70
|
-
}
|
|
71
|
-
return { samples, referenceImpedanceOhms };
|
|
72
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Complex } from '../complex/Complex.js';
|
|
2
|
-
/** Finite complex quotient without squaring the denominator or overflowing its sum. */
|
|
3
|
-
export function complexRatio(nr, ni, dr, di) {
|
|
4
|
-
const scale = Math.max(Math.abs(nr), Math.abs(ni), Math.abs(dr), Math.abs(di));
|
|
5
|
-
if (!Number.isFinite(scale) || (dr === 0 && di === 0)) {
|
|
6
|
-
return;
|
|
7
|
-
}
|
|
8
|
-
nr /= scale;
|
|
9
|
-
ni /= scale;
|
|
10
|
-
dr /= scale;
|
|
11
|
-
di /= scale;
|
|
12
|
-
let re;
|
|
13
|
-
let im;
|
|
14
|
-
if (Math.abs(dr) >= Math.abs(di)) {
|
|
15
|
-
const ratio = di / dr;
|
|
16
|
-
const denominator = dr + di * ratio;
|
|
17
|
-
re = (nr + ni * ratio) / denominator;
|
|
18
|
-
im = (ni - nr * ratio) / denominator;
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
const ratio = dr / di;
|
|
22
|
-
const denominator = di + dr * ratio;
|
|
23
|
-
re = (nr * ratio + ni) / denominator;
|
|
24
|
-
im = (ni * ratio - nr) / denominator;
|
|
25
|
-
}
|
|
26
|
-
if (!Number.isFinite(re) || !Number.isFinite(im)) {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
return Complex.from(re, im);
|
|
30
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Complex } from './complex/Complex.js';
|
|
2
|
-
import type { TraceSamples } from './samples.js';
|
|
3
|
-
/**
|
|
4
|
-
* Change the positive real reference impedance of a voltage reflection coefficient.
|
|
5
|
-
* Preserves physical impedance, including exact open/short limits. A singular or
|
|
6
|
-
* unrepresentable result is undefined; non-finite inputs throw RangeError.
|
|
7
|
-
*/
|
|
8
|
-
export declare function renormalizeReflection(gamma: Complex, fromOhms: number, toOhms: number): Complex | undefined;
|
|
9
|
-
/** Copy and renormalize every sample; reject invalid/singular data without modifying the input. */
|
|
10
|
-
export declare function renormalizeSamples(samples: TraceSamples, fromOhms: number, toOhms: number): TraceSamples;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { Complex } from './complex/Complex.js';
|
|
2
|
-
function validateReference(value) {
|
|
3
|
-
if (!Number.isFinite(value) || value <= 0) {
|
|
4
|
-
throw new RangeError('Reference impedance must be positive and finite.');
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Change the positive real reference impedance of a voltage reflection coefficient.
|
|
9
|
-
* Preserves physical impedance, including exact open/short limits. A singular or
|
|
10
|
-
* unrepresentable result is undefined; non-finite inputs throw RangeError.
|
|
11
|
-
*/
|
|
12
|
-
export function renormalizeReflection(gamma, fromOhms, toOhms) {
|
|
13
|
-
validateReference(fromOhms);
|
|
14
|
-
validateReference(toOhms);
|
|
15
|
-
if (!Number.isFinite(gamma.re) || !Number.isFinite(gamma.im)) {
|
|
16
|
-
throw new RangeError('Reflection coefficient components must be finite.');
|
|
17
|
-
}
|
|
18
|
-
if (fromOhms === toOhms || (gamma.im === 0 && Math.abs(gamma.re) === 1)) {
|
|
19
|
-
return gamma;
|
|
20
|
-
}
|
|
21
|
-
// Γnew = (Γold + k) / (1 + k Γold). Scale references before summing.
|
|
22
|
-
const referenceScale = Math.max(fromOhms, toOhms);
|
|
23
|
-
const from = fromOhms / referenceScale;
|
|
24
|
-
const to = toOhms / referenceScale;
|
|
25
|
-
const k = (fromOhms - toOhms) / referenceScale / (from + to);
|
|
26
|
-
const scale = Math.max(1, Math.abs(gamma.re), Math.abs(gamma.im));
|
|
27
|
-
const x = gamma.re / scale;
|
|
28
|
-
const y = gamma.im / scale;
|
|
29
|
-
const inverseScale = 1 / scale;
|
|
30
|
-
const nr = x + k * inverseScale;
|
|
31
|
-
const dr = inverseScale + k * x;
|
|
32
|
-
const di = k * y;
|
|
33
|
-
const denominatorScale = Math.max(Math.abs(dr), Math.abs(di));
|
|
34
|
-
if (denominatorScale === 0) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
const real = dr / denominatorScale;
|
|
38
|
-
const imaginary = di / denominatorScale;
|
|
39
|
-
const denominator = real ** 2 + imaginary ** 2;
|
|
40
|
-
const re = ((nr / denominatorScale) * real + (y / denominatorScale) * imaginary) / denominator;
|
|
41
|
-
// Analytic imaginary numerator avoids cancellation for very large finite Γ.
|
|
42
|
-
const im = (((1 - k) * (1 + k) * (y / denominatorScale)) / denominator) *
|
|
43
|
-
(inverseScale / denominatorScale);
|
|
44
|
-
return Number.isFinite(re) && Number.isFinite(im) ? Complex.from(re, im) : undefined;
|
|
45
|
-
}
|
|
46
|
-
/** Copy and renormalize every sample; reject invalid/singular data without modifying the input. */
|
|
47
|
-
export function renormalizeSamples(samples, fromOhms, toOhms) {
|
|
48
|
-
validateReference(fromOhms);
|
|
49
|
-
validateReference(toOhms);
|
|
50
|
-
return samples.map((sample, index) => {
|
|
51
|
-
if (!Number.isFinite(sample.frequencyHz) ||
|
|
52
|
-
sample.frequencyHz < 0 ||
|
|
53
|
-
sample.reflectionCoefficient.length !== 2) {
|
|
54
|
-
throw new RangeError(`Invalid sample at index ${index}.`);
|
|
55
|
-
}
|
|
56
|
-
const gamma = renormalizeReflection(Complex.from(...sample.reflectionCoefficient), fromOhms, toOhms);
|
|
57
|
-
if (!gamma) {
|
|
58
|
-
throw new RangeError(`Renormalization is singular or outside the numeric range at sample ${index}.`);
|
|
59
|
-
}
|
|
60
|
-
return { frequencyHz: sample.frequencyHz, reflectionCoefficient: gamma.toVector() };
|
|
61
|
-
});
|
|
62
|
-
}
|
package/dist/lib/rf.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { Complex } from './complex/Complex.js';
|
|
2
|
-
/** Physical quantities derived from a voltage reflection coefficient Γ. */
|
|
3
|
-
export interface SmithReading {
|
|
4
|
-
readonly reflectionCoefficient: Complex;
|
|
5
|
-
readonly impedanceOhms: Complex | undefined;
|
|
6
|
-
readonly admittanceSiemens: Complex | undefined;
|
|
7
|
-
readonly phaseDegrees: number | undefined;
|
|
8
|
-
readonly vswr: number | undefined;
|
|
9
|
-
readonly standingWaveRatioDb: number | undefined;
|
|
10
|
-
readonly returnLossDb: number;
|
|
11
|
-
readonly reflectionLossDb: number | undefined;
|
|
12
|
-
readonly attenuationDb: number | undefined;
|
|
13
|
-
readonly q: number | undefined;
|
|
14
|
-
readonly powerReflectionCoefficient: number;
|
|
15
|
-
readonly voltageReflectionCoefficientMagnitude: number;
|
|
16
|
-
readonly powerTransmissionCoefficient: number | undefined;
|
|
17
|
-
readonly voltageTransmissionCoefficientMagnitude: number;
|
|
18
|
-
readonly currentTransmissionCoefficientMagnitude: number;
|
|
19
|
-
readonly standingWavePeak: number | undefined;
|
|
20
|
-
readonly standingWaveLossCoefficient: number | undefined;
|
|
21
|
-
}
|
|
22
|
-
/** Convert Γ to physical impedance in ohms; undefined at the open circuit Γ = 1. */
|
|
23
|
-
export declare function reflectionToImpedance(gamma: Complex, referenceImpedanceOhms?: number): Complex | undefined;
|
|
24
|
-
/** Convert physical impedance in ohms to Γ. Undefined for a singular result. */
|
|
25
|
-
export declare function impedanceToReflection(impedanceOhms: Complex, referenceImpedanceOhms?: number): Complex | undefined;
|
|
26
|
-
/** Convert Γ to physical admittance in siemens; undefined at the short circuit Γ = −1. */
|
|
27
|
-
export declare function reflectionToAdmittance(gamma: Complex, referenceImpedanceOhms?: number): Complex | undefined;
|
|
28
|
-
/** Convert physical admittance in siemens to Γ. Undefined for a singular result. */
|
|
29
|
-
export declare function admittanceToReflection(admittanceSiemens: Complex, referenceImpedanceOhms?: number): Complex | undefined;
|
|
30
|
-
/**
|
|
31
|
-
* Read Γ without a chart or DOM. Undefined means a singular or inapplicable quantity.
|
|
32
|
-
* Passive-load quantities are undefined outside |Γ| ≤ 1; exact infinite limits are retained.
|
|
33
|
-
* Attenuation assumes a fully reflecting termination and is half the return loss.
|
|
34
|
-
*/
|
|
35
|
-
export declare function readReflection(gamma: Complex, referenceImpedanceOhms?: number): SmithReading;
|
package/dist/lib/rf.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { Complex } from './complex/Complex.js';
|
|
2
|
-
import { SmithConstantCircle } from './SmithConstantCircle.js';
|
|
3
|
-
const calcs = new SmithConstantCircle();
|
|
4
|
-
function validateReference(referenceImpedanceOhms) {
|
|
5
|
-
if (!Number.isFinite(referenceImpedanceOhms) || referenceImpedanceOhms <= 0) {
|
|
6
|
-
throw new RangeError('Reference impedance must be positive and finite.');
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
function validateComplex(value) {
|
|
10
|
-
if (!Number.isFinite(value.re) || !Number.isFinite(value.im)) {
|
|
11
|
-
throw new RangeError('Complex components must be finite.');
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
function finite(value) {
|
|
15
|
-
return value && Number.isFinite(value.re) && Number.isFinite(value.im) ? value : undefined;
|
|
16
|
-
}
|
|
17
|
-
/** Convert Γ to physical impedance in ohms; undefined at the open circuit Γ = 1. */
|
|
18
|
-
export function reflectionToImpedance(gamma, referenceImpedanceOhms = 50) {
|
|
19
|
-
validateReference(referenceImpedanceOhms);
|
|
20
|
-
validateComplex(gamma);
|
|
21
|
-
return finite(calcs.rflCoeffToImpedance(gamma)?.mul(referenceImpedanceOhms));
|
|
22
|
-
}
|
|
23
|
-
/** Convert physical impedance in ohms to Γ. Undefined for a singular result. */
|
|
24
|
-
export function impedanceToReflection(impedanceOhms, referenceImpedanceOhms = 50) {
|
|
25
|
-
validateReference(referenceImpedanceOhms);
|
|
26
|
-
validateComplex(impedanceOhms);
|
|
27
|
-
return finite(calcs.impedanceToRflCoeff(impedanceOhms.div(referenceImpedanceOhms)));
|
|
28
|
-
}
|
|
29
|
-
/** Convert Γ to physical admittance in siemens; undefined at the short circuit Γ = −1. */
|
|
30
|
-
export function reflectionToAdmittance(gamma, referenceImpedanceOhms = 50) {
|
|
31
|
-
validateReference(referenceImpedanceOhms);
|
|
32
|
-
validateComplex(gamma);
|
|
33
|
-
return finite(calcs.rflCoeffToAdmittance(gamma)?.div(referenceImpedanceOhms));
|
|
34
|
-
}
|
|
35
|
-
/** Convert physical admittance in siemens to Γ. Undefined for a singular result. */
|
|
36
|
-
export function admittanceToReflection(admittanceSiemens, referenceImpedanceOhms = 50) {
|
|
37
|
-
validateReference(referenceImpedanceOhms);
|
|
38
|
-
validateComplex(admittanceSiemens);
|
|
39
|
-
return finite(calcs.admittanceToRflCoeff(admittanceSiemens.mul(referenceImpedanceOhms)));
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Read Γ without a chart or DOM. Undefined means a singular or inapplicable quantity.
|
|
43
|
-
* Passive-load quantities are undefined outside |Γ| ≤ 1; exact infinite limits are retained.
|
|
44
|
-
* Attenuation assumes a fully reflecting termination and is half the return loss.
|
|
45
|
-
*/
|
|
46
|
-
export function readReflection(gamma, referenceImpedanceOhms = 50) {
|
|
47
|
-
const impedanceOhms = reflectionToImpedance(gamma, referenceImpedanceOhms);
|
|
48
|
-
const admittanceSiemens = reflectionToAdmittance(gamma, referenceImpedanceOhms);
|
|
49
|
-
const magnitude = gamma.abs();
|
|
50
|
-
const passive = magnitude <= 1;
|
|
51
|
-
const returnLossDb = -20 * Math.log10(magnitude);
|
|
52
|
-
const vswr = passive ? (1 + magnitude) / (1 - magnitude) : undefined;
|
|
53
|
-
return {
|
|
54
|
-
reflectionCoefficient: gamma,
|
|
55
|
-
impedanceOhms,
|
|
56
|
-
admittanceSiemens,
|
|
57
|
-
phaseDegrees: magnitude === 0 ? undefined : (gamma.arg() * 180) / Math.PI,
|
|
58
|
-
vswr,
|
|
59
|
-
standingWaveRatioDb: vswr === undefined ? undefined : 20 * Math.log10(vswr),
|
|
60
|
-
returnLossDb,
|
|
61
|
-
reflectionLossDb: passive ? (-10 / Math.LN10) * Math.log1p(-(magnitude ** 2)) : undefined,
|
|
62
|
-
attenuationDb: passive ? returnLossDb / 2 : undefined,
|
|
63
|
-
q: impedanceOhms && (impedanceOhms.re !== 0 || impedanceOhms.im !== 0)
|
|
64
|
-
? Math.abs(impedanceOhms.im / impedanceOhms.re)
|
|
65
|
-
: undefined,
|
|
66
|
-
powerReflectionCoefficient: magnitude ** 2,
|
|
67
|
-
voltageReflectionCoefficientMagnitude: magnitude,
|
|
68
|
-
powerTransmissionCoefficient: passive ? 1 - magnitude ** 2 : undefined,
|
|
69
|
-
voltageTransmissionCoefficientMagnitude: gamma.add(1).abs(),
|
|
70
|
-
currentTransmissionCoefficientMagnitude: Complex.one().sub(gamma).abs(),
|
|
71
|
-
standingWavePeak: vswr === undefined ? undefined : Math.sqrt(vswr),
|
|
72
|
-
standingWaveLossCoefficient: passive ? (1 + magnitude ** 2) / (1 - magnitude ** 2) : undefined,
|
|
73
|
-
};
|
|
74
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { Complex } from '../complex/Complex.js';
|
|
2
|
-
export interface PeripheralScale {
|
|
3
|
-
id: string;
|
|
4
|
-
title: string;
|
|
5
|
-
unit: '°' | 'λ';
|
|
6
|
-
ticks: number[];
|
|
7
|
-
major: (value: number) => boolean;
|
|
8
|
-
angle: (value: number) => number;
|
|
9
|
-
read: (gamma: Complex) => number | null;
|
|
10
|
-
}
|
|
11
|
-
/** A full reflection-coefficient rotation represents half a wavelength along the line. */
|
|
12
|
-
export declare function peripheralScales(): PeripheralScale[];
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
function phase(gamma) {
|
|
2
|
-
return gamma.re === 0 && gamma.im === 0 ? null : (Math.atan2(gamma.im, gamma.re) * 180) / Math.PI;
|
|
3
|
-
}
|
|
4
|
-
/** A full reflection-coefficient rotation represents half a wavelength along the line. */
|
|
5
|
-
export function peripheralScales() {
|
|
6
|
-
const wavelengths = (gamma, direction) => {
|
|
7
|
-
const degrees = phase(gamma);
|
|
8
|
-
return degrees === null ? null : (0.25 + (direction * degrees) / 720 + 0.5) % 0.5;
|
|
9
|
-
};
|
|
10
|
-
return [
|
|
11
|
-
{
|
|
12
|
-
id: 'transmission-phase',
|
|
13
|
-
title: 'Transmission phase · °',
|
|
14
|
-
unit: '°',
|
|
15
|
-
ticks: Array.from({ length: 179 }, (_, i) => -89 + i),
|
|
16
|
-
major: (v) => v % 5 === 0,
|
|
17
|
-
// Project from Γ = −1 to the perimeter, not from the chart center.
|
|
18
|
-
angle: (v) => 2 * v,
|
|
19
|
-
read: (gamma) => phase({ re: 1 + gamma.re, im: gamma.im }),
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
id: 'reflection-phase',
|
|
23
|
-
title: 'Reflection phase · °',
|
|
24
|
-
unit: '°',
|
|
25
|
-
ticks: Array.from({ length: 180 }, (_, i) => -178 + i * 2),
|
|
26
|
-
major: (v) => v % 10 === 0,
|
|
27
|
-
angle: (v) => v,
|
|
28
|
-
read: phase,
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
id: 'wavelengths-load',
|
|
32
|
-
title: 'Wavelengths → load',
|
|
33
|
-
unit: 'λ',
|
|
34
|
-
ticks: Array.from({ length: 250 }, (_, i) => i / 500),
|
|
35
|
-
major: (v) => Math.round(v * 500) % 5 === 0,
|
|
36
|
-
angle: (v) => 720 * v - 180,
|
|
37
|
-
read: (gamma) => wavelengths(gamma, 1),
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
id: 'wavelengths-generator',
|
|
41
|
-
title: 'Wavelengths → generator',
|
|
42
|
-
unit: 'λ',
|
|
43
|
-
ticks: Array.from({ length: 250 }, (_, i) => i / 500),
|
|
44
|
-
major: (v) => Math.round(v * 500) % 5 === 0,
|
|
45
|
-
angle: (v) => 180 - 720 * v,
|
|
46
|
-
read: (gamma) => wavelengths(gamma, -1),
|
|
47
|
-
},
|
|
48
|
-
];
|
|
49
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { Complex } from '../complex/Complex.js';
|
|
2
|
-
export interface RadialScale {
|
|
3
|
-
id: string;
|
|
4
|
-
title: string;
|
|
5
|
-
description?: string;
|
|
6
|
-
unit: 'dB' | 'ratio';
|
|
7
|
-
read: (gamma: Complex) => number;
|
|
8
|
-
values: number[];
|
|
9
|
-
position: (value: number) => number;
|
|
10
|
-
}
|
|
11
|
-
/** Normalized positions along each scale, from zero to one. */
|
|
12
|
-
export declare function radialScales(): RadialScale[];
|