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

PropTypeDefaultDescription
titlestringby mode, e.g. "The p-distance on the plane"Title bar text.
controlsstring[]all controls shownIds 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 ballball: 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.
pnumber | "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).
pointsnumber[][] | 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 xRangeVisible y range (plane modes; equal scale on both axes).
showTrianglebooleantrueBall mode with three points: draw the detour x -> y -> z and check the triangle inequality.
showParallelogrambooleanfalseBall 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).
qnumber | "inf""inf"Equivalence mode: exponent of the second norm, whose ball is dilated by c.
cnumber1Equivalence mode: starting dilation factor of the second ball (the learner slides it).
matrixnumber[][][[2, 1], [0, 1]]Operator-norm mode: the 2x2 matrix A acting on the unit ball.
showConditionbooleantrueOperator-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).
showDualBallbooleanfalseDual mode: start with the dual unit ball B_q drawn.
candidatesstring[]["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), ...).
candidatenumber | string0Metric-check mode: the candidate selected at start, by index or by formula (a formula not in the list is appended).
allowCustombooleantrueMetric-check mode: false hides the box where learners type their own formula.
showSearchbooleanfalseMetric-check mode: start with the grid search for counterexamples already run for the selected candidate.