Norm Unit Ball Explorer
The unit ball of a p-distance or p-norm in the plane. The learner slides p, drags points and watches distances and the triangle inequality (which breaks for p < 1); other modes dilate a second ball (norm equivalence), let a matrix act on the ball (operator norm, condition number), draw a functional's level lines (Hölder's inequality and its equality case), or check candidate distance formulas on the real line axiom by axiom with a counterexample search.
Used in: Mathematical Analysis
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| title | string | by mode, e.g. "The p-distance on the plane" | Title bar text. |
| controls | string[] | all controls shown | Ids of the hideable controls and text blocks to show (see the controls registry, e.g. readout.norm, toggle.parallelogram, readout.condition, toggle.dual-ball). Core controls always show. Page building fills this from the subject's topic scope. |
| mode | "ball" | "equivalence" | "operator-norm" | "dual" | "metric-check" | inferred: candidates -> metric-check, g -> dual, matrix -> operator-norm, q -> equivalence, else ball | ball: p-distance d_p on the plane with up to three draggable points, their distances and the triangle inequality. equivalence: B_p against a dilated ball c·B_q. operator-norm: a 2x2 matrix maps the unit ball; drag u to compare the stretch with ||A||_p. dual: level lines of x -> g·x, Hölder's inequality and its equality case. metric-check: candidate distance formulas d(x, y) on the real line checked axiom by axiom. |
| p | number | "inf" | 2 (3 in dual mode) | Starting exponent of the distance / norm (> 0; "inf" = max). The learner changes it with the slider and presets. Dual mode needs p >= 1. |
| pRange | [number, number] | [1, 8] | Range of the p slider. Use [0.5, 8] to let learners see d_p fail the triangle inequality for p < 1. Widened to include p. |
| pChoices | (number | "inf")[] | [1, 2, "inf"] | Preset buttons beside the p slider ([] hides them). |
| points | number[][] | number[] | ball: [[1, 0], [0, 0], [0, 1]]; metric-check: [0, 1, 2] | Plane modes: one to three draggable points [x, y]. Ball mode names them x, y, z (three points show the triangle inequality d(x,z) <= d(x,y) + d(y,z); one point shows its distance from 0); operator-norm and dual modes use the first as the starting vector u / x. Metric-check: three numbers [x, y, z] on the real line. |
| xRange | [number, number] | [-1.6, 1.6] (metric-check [-3, 3]; operator-norm fits the image) | Visible x range. In metric-check it is the number line and the grid the counterexample search scans. |
| yRange | [number, number] | same as xRange | Visible y range (plane modes; equal scale on both axes). |
| showTriangle | boolean | true | Ball mode with three points: draw the detour x -> y -> z and check the triangle inequality. |
| showParallelogram | boolean | false | Ball mode: start with the parallelogram-law readout on (||x+z||^2 + ||x-z||^2 against 2||x||^2 + 2||z||^2; equal for every pair only when p = 2). |
| q | number | "inf" | "inf" | Equivalence mode: exponent of the second norm, whose ball is dilated by c. |
| c | number | 1 | Equivalence mode: starting dilation factor of the second ball (the learner slides it). |
| matrix | number[][] | [[2, 1], [0, 1]] | Operator-norm mode: the 2x2 matrix A acting on the unit ball. |
| showCondition | boolean | true | Operator-norm mode: false hides the condition number κ_p(A) = ||A||_p ||A^-1||_p. |
| g | [number, number] | [1, 2] | Dual mode: the vector of the functional x -> g·x (nonzero). |
| showDualBall | boolean | false | Dual mode: start with the dual unit ball B_q drawn. |
| candidates | string[] | ["abs(x - y)", "(x - y)^2", "sqrt(abs(x - y))", "abs(x - y)/(1 + abs(x - y))"] | Metric-check mode: candidate distance formulas in x and y (abs, sqrt, ^, min, max, if(cond, a, b), ...). |
| candidate | number | string | 0 | Metric-check mode: the candidate selected at start, by index or by formula (a formula not in the list is appended). |
| allowCustom | boolean | true | Metric-check mode: false hides the box where learners type their own formula. |
| showSearch | boolean | false | Metric-check mode: start with the grid search for counterexamples already run for the selected candidate. |