Mathematics · Article
Mathematics in art, music and design
Connect geometric design, musical ratios and rhythms, and digital representations through explicit mathematical models and worked examples.
Back to MathematicsAfter reading, you can
- Compute the effects of geometric transformations on lengths, signed areas and orientations.
- Use symmetry, lattice cells and planar angles to reason about repeating designs.
- Derive projection, interpolation, Bézier joins and compositing formulas from declared coordinates.
- Calculate frequency ratios, logarithmic intervals, beats and cyclic onset counts.
- Explain how harmonic orthogonality, sampling and amplitude quantization affect a signal model.
- Prove approximation bounds and determine exact scale or covering relationships.
From a design rule to a mathematical consequence
A visual design can repeat a transformation, tile a region or join simple curves. A musical pattern can repeat a frequency ratio or place onsets on a shared time grid. Each example begins by specifying the exact rule so its consequences can be calculated.
The lesson uses matrices, spatial projection and affine weights to describe shapes and images. Linear color layers and luminance ratios separate mathematical operations that affect a drawing in different ways. Tuning, beats and harmonic sums introduce time, frequency and the effect of measuring along a discrete grid.
The last sections make approximation explicit. They bound quantization and chord errors, show how a recursive design can have zero area and noninteger covering exponent, and fit a scale and translation to corresponding marks. Every result keeps its units and scope.
Scale a drawing while preserving its shape
For two points x and y, subtract their images under F to obtain F(x)−F(y)=sQ(x−y). The translation cancels. If u and v are two difference vectors, their transformed dot product is s²uᵀQᵀQv=s²u·v.
With u=v this gives ‖sQu‖²=s²‖u‖². Since s>0, each distance is multiplied by s. Dividing the dot-product relation by the product of the two new lengths gives the same cosine between any two nonzero differences.
For a triangle, the absolute determinant of its two side vectors is twice its area. The two transformed columns multiply this determinant by det(sQ)=s² det Q. Orthogonality gives (det Q)²=1, so the absolute area multiplier is s².
A polygonal region can be divided into triangles with disjoint interiors. The map is one-to-one, so the triangle images again have disjoint interiors and their areas add. The polygon area is multiplied by s² whether the orthogonal part preserves or reverses orientation. See [The magnitude and sign of an area multiplier](https://ocw.mit.edu/courses/18-06-linear-algebra-spring-2010/650a197f93607b9751e0cc4b5a11b647_MIT18_06S10_L20.pdf), [Norm definitions and finite-dimensional comparison](https://web.stanford.edu/~boyd/cvxbook/bv_cvxbook.pdf#page=649). The distance and dot-product factors follow from orthogonal multiplication. Absolute determinant scaling gives the triangle and polygon areas.
Control area with a linear drawing transform
For ordered triangle vertices p,q,r, use the signed area ½ det[q−p, r−p]. The two columns are the displacement vectors from p, and changing their order reverses the sign.
After applying A, the corresponding matrix is A[q−p, r−p]. Multiplication of determinants makes the signed area become det A times its original value. Ordinary area therefore has multiplier |det A|. The formula includes det A=0, when the image has zero area.
For a horizontal shear with parameter k, the map is (x,y)↦(x+ky,y). Its two column vectors are (1,0) and (k,1), so its determinant is one.
The signed doubled area is the determinant of the two side vectors. Applying T to both vectors multiplies this determinant by det T.
| Quantity | Exact result |
|---|---|
| Original vertices | (0, 0), (1, 0), (0, 2) |
| Transformed vertices | (0, 0), (2, 0), (0, 2) |
| Signed doubled area before | 2 |
| Signed doubled area after | 4 |
| Determinant | 2 |
| Ordinary unsigned area before and after | 1 and 2 |
Exact inputs and supporting calculations
| Parameter | Value |
|---|---|
| T | [[2,0],[0,1]] |
| pts | [[0,0],[1,0],[0,2]] |
With k≠0 a vertical unit side tilts to (k,1) and changes length, while a horizontal side stays fixed. The unit square becomes a parallelogram of base and height one. This verifies that area can be preserved while lengths and angles change. See [The magnitude and sign of an area multiplier](https://ocw.mit.edu/courses/18-06-linear-algebra-spring-2010/650a197f93607b9751e0cc4b5a11b647_MIT18_06S10_L20.pdf). The two column differences determine signed area, so the determinant multiplies it. A shear preserves area while changing a perpendicular side.
Compose two reflections
For intersecting reflecting lines put their intersection at the origin. In complex coordinates reflection in the line at angle α first rotates by −α, conjugates, and rotates back. Its formula is S_α(z)=e^(2iα)·conj(z).
Apply the second reflection at angle β. The image is e^(2iβ)·conj(e^(2iα)·conj(z))=e^(2i(β−α))z. This is rotation through the oriented angle 2(β−α), about the original intersection.
For parallel lines choose a shared unit normal n and constants a,b with equations n·x=a and n·x=b. The first reflection changes the normal coordinate u=n·x to 2a−u and leaves the tangential component fixed.
The second reflection changes that normal coordinate to 2b−(2a−u)=u+2(b−a). The entire composition is translation by 2(b−a)n. Swapping the reflection order reverses the signed rotation angle or translation vector. See [Reflections, rotations and glides of the plane](https://kconrad.math.uconn.edu/blurbs/grouptheory/isometrycpx.pdf). Conjugation represents a reflection through a line through the origin. Parallel axes require a separate normal-coordinate calculation.
Find the square of a glide reflection
Put one coordinate axis along the reflecting line and the origin on that line. In these coordinates reflection is S(x,y)=(x,−y). Translation along the line by a nonzero signed distance a is T(x,y)=(x+a,y).
Both orders produce (x+a,−y), so the two operations commute. The glide G is represented by that formula on the entire plane.
Applying G a second time gives (x+2a,y). Thus the square is translation by twice the original translation vector, with the normal sign reversed twice.
Horizontal translation commutes with reflection in a horizontal line. Squaring their composition cancels the reflections and adds the translations.
| Quantity | Exact result |
|---|---|
| First image | (2, -1) |
| Second image | (4, 3) |
| Net translation | (4, 0) |
| Pure reflection | False |
Exact inputs and supporting calculations
| Parameter | Value |
|---|---|
| k | 1 |
| h | 2 |
| P | [0,3] |
A fixed point would need x+a=x, which is impossible when a≠0. When a=0 the operation becomes pure reflection and all points on the axis are fixed. The condition on the translation is therefore essential. See [Reflections, rotations and glides of the plane](https://kconrad.math.uconn.edu/blurbs/grouptheory/isometrycpx.pdf). The translation has zero normal component, which gives commutation. Doubling that translation describes the square and its fixed-point behavior.
Count the symmetries of a regular polygon
Start with a regular n-gon with n≥3. Every Euclidean symmetry permutes its vertices and sends any chosen adjacent vertex pair to another adjacent vertex pair. The image of the first vertex has n choices, and the image of its chosen neighbor has two.
All such symmetries fix the unique circumcenter. The center and the two original adjacent vertices are noncollinear. A Euclidean isometry is determined by three noncollinear points and their images, so at most 2n symmetries are possible.
Take r to be rotation by 2π/n about the center. A reflection s across the line through the center and a chosen vertex preserves the polygon. The n maps rᵏ preserve cyclic order and the n maps srᵏ reverse it. Within each group the image of a chosen vertex distinguishes the maps, and the order distinction makes the two groups disjoint.
Reflection changes the sense of rotation and fixes the center. In complex coordinates centered there, conjugating multiplication by e^(2πi/n) with s replaces it by multiplication by e^(−2πi/n). Thus srs=r⁻¹ and the displayed 2n transformations exhaust the symmetries. See [Rotations and reflections in a regular polygon](https://kconrad.math.uconn.edu/blurbs/grouptheory/dihedral.pdf), [Reflections, rotations and glides of the plane](https://kconrad.math.uconn.edu/blurbs/grouptheory/isometrycpx.pdf). An ordered polygon edge and its circumcenter distinguish every isometry. The rotations and reflected rotations attain the bound.
Change a lattice basis without changing its points
Write L=Bℤ² for the lattice, with B an invertible real matrix. For any integer M, the coordinates of non-translated points generated by BM are Mz with z∈ℤ², so BMℤ² is contained in L.
Suppose the lattices coincide. Each column of B is then BM times some integer vector. Write these two vectors as the columns of an integer matrix N. The resulting equality B=BMN gives I=MN after multiplying by B⁻¹.
Determinants of M and N are integers whose product is one. Hence det M is one or minus one, including the requirement that M is nonsingular.
Conversely if det M is ±1, the adjugate formula makes M⁻¹ an integer matrix. For every integer old coordinate z, the new coordinate M⁻¹z is integer and BM(M⁻¹z)=Bz. This gives the reverse containment and proves equality. See [Lattice basis changes and a fundamental cell](https://www.ams.jhu.edu/~abasu9/AMS_550-666/lattice-lecture-1.pdf). Equality of lattices means old basis vectors have integer coordinates in the new basis. The reverse integer coordinate matrix forces determinant ±1.
Measure one repeating cell
Let B have columns u and v. For any plane point x, write its unique coordinates as a=B⁻¹x. Subtract the lattice vector with coordinates (⌊a₁⌋,⌊a₂⌋). The remaining coordinates are in [0,1), so every coset has a representative in the half-open cell.
If two representatives in that cell differed by a lattice vector, each coordinate difference would be an integer in (−1,1). Both differences would be zero, proving uniqueness.
Opposite cell edges are parallel, and its area is |det B|. Excluding the upper boundaries only affects edges of zero planar area and ensures that distinct translated cells assign boundary points uniquely.
Take an aligned m-by-n block of such cells based at a lattice point, with positive integers m,n. Its half-open coefficient ranges contain exactly mn integer pairs, so it contains mn lattice points and has area mn|det B|. The number per area for such blocks is 1/|det B|. See [Lattice basis changes and a fundamental cell](https://www.ams.jhu.edu/~abasu9/AMS_550-666/lattice-lecture-1.pdf). Taking coordinate floors chooses one representative in the half-open cell. The determinant gives its area and the aligned lattice point density.
Find the regular polygons that can tile edge to edge
An edge-to-edge tiling meets at each vertex by whole edges and polygon corners. For a regular p-gon the interior angle is (p−2)π/p, obtained by dividing the sum of its p interior angles by p.
If k identical corners meet at the vertex, their angles sum to 2π. The equation k(p−2)=2p can be rewritten as (p−2)(k−2)=4. Since p≥3 and each angle is below π, k is also at least three.
The positive factor pairs of four are (1,4),(2,2),(4,1). They yield respectively (p,k)=(3,6),(4,4),(6,3). The angle argument gives a necessary condition under the congruent edge-to-edge rules.
Every interior angle of a regular n-gon is 180(n−2)/n degrees. Local equality to 360 degrees is necessary for a flat edge-to-edge tiling; it does not prove a global tiling for arbitrary mixed patterns.
| Quantity | Exact result |
|---|---|
| Interior angles | 60°, 120°, 60°, 120° |
| Total | 360° |
| Angular gap | 0° |
| Local angle condition | True |
Exact inputs and supporting calculations
| Parameter | Value |
|---|---|
| n | [3,6,3,6] |
Square cells come from perpendicular evenly spaced grid lines. Equilateral triangular cells come from splitting the rhombi of a triangular lattice along their short diagonals. Nearest-site cells of that same lattice give congruent regular hexagons, with the adjacent construction checking all six supporting sides. See [Angles that meet in a regular tiling](https://www.math.cmu.edu/~bkell/21110-2010s/symmetry-tilings.html). Complete angle sums at edge-to-edge vertices reduce to the three integer factor pairs. All three cases have constructions with whole sides meeting.
Make hexagonal cells from triangular-lattice sites
For a lattice vector v, a point x is at least as near the origin as to v exactly when x·v≤‖v‖²/2, obtained by comparing squared distances. A site with coordinates (i,j) in the given basis has squared length i²+ij+j².
The expression equals (i+j/2)²+3j²/4. For squared length one the last term forces j to be −1, 0 or 1. When j=0, i=±1. For j=1, i is −1 or 0, and for j=−1, i is 0 or 1. These six unit vectors have directions sixty degrees apart. For any other nonzero lattice vector the squared length is at least three, since it is a positive integer congruent to (i−j)² modulo three and therefore cannot equal two.
The six unit-neighbor inequalities bound a regular hexagon. Its side lines are each at distance 1/2 from zero and have equally spaced outward normals. Their consecutive intersections have distance (1/2)/cos(π/6)=1/√3 from zero, so every point in the hexagon has norm at most 1/√3.
For any other v, Cauchy–Schwarz gives x·v≤‖v‖/√3≤‖v‖²/2 because ‖v‖≥√3. Thus the remaining constraints do not cut the hexagon. Each plane point has a nearest site because the lattice is discrete and its site norms grow with the integer-coordinate norm. Translates of the hexagon therefore cover the plane with disjoint interiors and shared sides. See [Nearest-site regions and affine interpolation](https://graphics.stanford.edu/courses/cs205a-13-fall/assets/notes/cs205a_notes.pdf#page=168), [Lattice basis changes and a fundamental cell](https://www.ams.jhu.edu/~abasu9/AMS_550-666/lattice-lecture-1.pdf). Squared distance comparisons give the supporting lines. The six first-shell directions suffice because the further lattice lengths exceed the required bound.
Derive a vanishing point from central projection
Let the line be P+t d with nonzero direction d=(d_x,d_y,d_z) and initial coordinates P=(X₀,Y₀,Z₀). On the visible portion write the image as f(X₀+t d_x,Y₀+t d_y)/(Z₀+t d_z).
When d_z≠0, let t tend in the direction that makes Z₀+t d_z tend to positive infinity. Dividing numerator and denominator by t gives the limit (f d_x/d_z,f d_y/d_z). Parallel spatial lines of this direction share that finite limit.
The projected coordinate pair is this limiting pair plus f times (X₀−Z₀d_x/d_z,Y₀−Z₀d_y/d_z) divided by the visible depth. If the correction vector vanishes, the visible part projects to the same point throughout. That condition means the original line passes through the projection center.
When d_z=0 and Z₀>0, depth stays fixed. The image is an affine line with direction f(d_x,d_y)/Z₀, which is nonzero by the line assumption. There is no finite limit along unbounded t. A constant nonpositive depth gives no points in the declared visible domain. See [The limiting location of a projected line](https://visionbook.mit.edu/3d_scene_understanding_single_view.html#vanishing-points), [A picture as a section of the visual pyramid](https://it.wikisource.org/wiki/Della_pittura_%28Alberti%29/Libro_primo). The historical text describes a planar section of visual rays. The explicit coordinate proof derives the depth limit, the line exception and the point-image case.
Preserve the order-sensitive ratio of four projective coordinates
For four distinct finite inputs x₁,x₂,x₃,x₄, let F(x)=(ax+b)/(cx+d) and use the ordered cross-ratio ((x₁−x₃)(x₂−x₄))/((x₁−x₄)(x₂−x₃)). Let Δ=ad−bc≠0 and assume D_i=cx_i+d is nonzero for all four inputs. For any two of them the difference of their images is F(x_i)−F(x_j)=Δ(x_i−x_j)/(D_iD_j). This follows by expanding the two products over their common denominator.
The image differences are nonzero when the input differences are nonzero, so the cross-ratio with the new four coordinates is defined in the same order.
In the numerator, the two difference factors together supply Δ² divided by D₁D₂D₃D₄. The two denominator factors supply exactly the same common multiplier. Cancelling it leaves the original cross-ratio.
The conclusion uses the same ordered labeling of all four points. Relabeling may change the value. The proof covers finite coordinates away from poles, including an affine coordinate map when c=0 and d≠0. See [Projective invariance of a four-point cross-ratio](https://opi-lab.github.io/computer-vision/Hartley-Zisserman-chapter-02.pdf). Taking differences of finite nonpolar projective coordinates gives a common product of denominators. The same factor cancels for the declared four-point order.
Locate and interpolate inside a triangle
For any point X write X−A=b(B−A)+c(C−A). The two difference columns are independent since the triangle is nondegenerate, so the real coefficients b and c are unique. With a=1−b−c this gives X=aA+bB+cC and a+b+c=1.
If a,b,c are all nonnegative, X is a convex combination of the vertices and lies in their closed triangle. Conversely that closed convex hull consists exactly of those convex combinations. A zero coefficient places the point on the opposite edge or one of that edge’s endpoints.
Let g(X)=u·X+d be a scalar affine field. Substitution and the coefficient sum give g(X)=a g(A)+b g(B)+c g(C). Thus the interpolation reproduces any such field, including its constant term.
Given any three scalar vertex values, the same formula defines an affine field because b and c are affine functions of X. It is the unique affine field with those values. Outside the closed triangle some weight is negative, so the same formula extrapolates without guaranteeing a value within the input range. See [Nearest-site regions and affine interpolation](https://graphics.stanford.edu/courses/cs205a-13-fall/assets/notes/cs205a_notes.pdf#page=168). The two independent edge vectors give unique affine weights. Nonnegative weights characterize the triangle and affine values reproduce exactly.
Read a quadratic Bézier curve from its controls
Write B(t)=(1−t)²P₀+2t(1−t)P₁+t²P₂. At t=0 only the first weight survives, and at t=1 only the last does. The endpoint positions are P₀ and P₂.
Differentiate the weights and group the result by successive control differences. The vector derivative is B′(t)=2(1−t)(P₁−P₀)+2t(P₂−P₁).
The endpoint derivative vectors are 2(P₁−P₀) and 2(P₂−P₁). If one is nonzero it determines the oriented tangent there. A zero endpoint derivative does not supply an oriented tangent direction by this formula alone.
For 0≤t≤1 the three weights are nonnegative and sum to ((1−t)+t)²=1. Thus every curve point is a convex combination of the controls and belongs to their convex hull. The argument includes collinear or repeated controls. See [Derivatives and joins of Bézier curves](https://pages.mtu.edu/~shene/COURSES/cs3621/NOTES/spline/Bezier/bezier-der.html). Bernstein weights give the convex-hull property. Differentiating yields the two endpoint control differences with their signs.
Subdivide a quadratic Bézier curve exactly
Write the quadratic as B(t)=P₀+2t(P₁−P₀)+t²(P₀−2P₁+P₂). At a split a, form U=(1−a)P₀+aP₁ and V=(1−a)P₁+aP₂. The point W=(1−a)U+aV equals B(a) by expansion.
Take the left controls to be P₀,U,W. The coefficient of the new parameter s is 2(U−P₀)=2a(P₁−P₀). Its quadratic coefficient W−2U+P₀ is a²(P₀−2P₁+P₂), obtained by substituting W=B(a) and the formula for U.
Thus the left curve equals B(as). For the right side first reverse the original controls, which replaces t by 1−t, and take the left split of that reversed curve at 1−a. Its controls are P₂,V,W and it represents B(1−(1−a)s).
At each level interpolate endpoints with weights 1−t and t. The outer two edges of the interpolation triangle give the exact control polygons of the two Bézier pieces.
| Quantity | Exact result |
|---|---|
| Q₀ | (1, 2) |
| Q₁ | (3, 2) |
| Split point | (2, 2) |
| Left control polygon | (0, 0) → (1, 2) → (2, 2) |
| Right control polygon | (2, 2) → (3, 2) → (4, 0) |
Exact inputs and supporting calculations
| Parameter | Value |
|---|---|
| P | [[0,0],[2,4],[4,0]] |
| t | 1/2 |
Reverse that left control triple to get W,V,P₂. Replacing s by 1−s in the last expression gives B(a+(1−a)s), which is precisely the right interval with an increasing parameter. Both pieces therefore meet at W without any approximation. See [Split controls from the interpolation triangle](https://pages.mtu.edu/~shene/COURSES/cs3621/NOTES/spline/Bezier/bezier-sub.html). Interpolate controls to the common endpoint, then compare both new quadratics with their exact increasing reparameterizations.
Match the join of two cubic curves
A cubic with controls P₀ through P₃ is the sum of their Bernstein weights (1−t)³, 3t(1−t)², 3t²(1−t) and t³. Evaluating shows the start and end are P₀ and P₃. Taking the derivative at the endpoints gives 3(P₁−P₀) and 3(P₃−P₂).
If a piece takes physical or drawing time D>0 and its parameter advances linearly from zero to one, then parameter rate is 1/D. Multiply each endpoint derivative by this rate to get a velocity in position units per time unit.
Let the next piece have controls Q₀ through Q₃ and duration E>0. A continuous join needs P₃=Q₀. The one-sided velocities then match exactly when (P₃−P₂)/D=(Q₁−Q₀)/E, with the common factor three cancelled.
When the two velocity vectors are nonzero and point in the same direction, one is a positive multiple of the other and the oriented tangent directions match. A positive multiple different from one still gives different velocities. If both velocities vanish they match as derivatives, but these derivatives alone do not give directions. See [Derivatives and joins of Bézier curves](https://pages.mtu.edu/~shene/COURSES/cs3621/NOTES/spline/Bezier/bezier-der.html). A piece’s elapsed duration rescales its endpoint derivative. Positional continuity, velocity equality and nonzero tangent direction are separate conditions.
Find a centroid after a cutout
For a bounded measurable uniform region U of positive area A, define its centroid vector as A⁻¹ times the integral of the position vector over U. Uniform density cancels from this ratio of the first moment to mass.
When two parts U and V share at most a set of area zero, their areas add and their first-moment integrals add. If their areas and centroids are A_U,A_V and c_U,c_V, the union’s centroid is (A_U c_U+A_V c_V)/(A_U+A_V).
If a cutout V lies inside U with area strictly smaller than A_U, subtract its moment and its area. The remaining centroid is (A_U c_U−A_V c_V)/(A_U−A_V). Edge inclusion has no effect when the affected boundary has area zero.
Under reflection symmetry the integral of the signed normal distance to the reflection axis is zero. Reflected points have the same area weights and opposite normal distances. Hence the centroid of the region lies on that axis. See [Centroid as a normalized first moment](https://openstax.org/books/calculus-volume-2/pages/2-6-moments-and-centers-of-mass). Constant density cancels in the normalized area moments. A cutout subtracts both its area and its first moment, preserving any remaining reflection symmetry.
Maximize a fixed-ratio crop
For a crop of width w and fixed width-to-height ratio r, its height is w/r. The axis-aligned containment conditions are exactly w≤W and w/r≤H. A rectangle of those dimensions can be placed at the lower left whenever both inequalities hold.
The crop area as a function of its positive width is w²/r, strictly increasing. Its maximum therefore uses w=min(W,rH), which is a positive allowed value.
If W≤rH, the maximum crop uses full width W and height W/r. If W≥rH, it uses full height H and width rH. Both formulas coincide at W=rH, where the entire rectangle fits.
For a largest crop the horizontal location may vary over an interval of length W−w, and the vertical location over length H−w/r. At least one of these lengths is zero. Additional integer pixel or rotation rules would give a different feasible set. See [Largest rectangle with a constrained aspect ratio](https://www.w3.org/TR/css-images-3/#cover-contain). The feasible width is bounded by the source width and by ratio times source height. Maximization then follows from monotone area.
Compose translucent layers in linear coordinates
Represent each layer by premultiplied linear channel vector c and opacity α, with 0≤α≤1. Placing this over a layer (d,β) keeps its own channels and contributes the background channels multiplied by the uncovered fraction 1−α.
The combined ordered pair is (c+(1−α)d, α+(1−α)β). The uncovered fraction of this pair is (1−α)(1−β), as seen by subtracting the new opacity from one.
Over a third pair (e,γ), either grouping gives channels c+(1−α)d+(1−α)(1−β)e and opacity α+(1−α)β+(1−α)(1−β)γ. Thus grouping while preserving the layer order leaves the result unchanged.
For half-opaque red and half-opaque blue, red over blue gives premultiplied channels (1/2,0,1/4) and opacity 3/4. Reversing the layer order gives (1/4,0,1/2) at the same opacity. The color comparison uses declared linear channels. See [Source-over color and opacity](https://www.w3.org/TR/compositing-1/#simplealphacompositing). The uncovered opacity fractions multiply under grouping. The channel and opacity calculations yield associativity for an unchanged layer order.
Choose higher mathematical contrast against a uniform background
In this model black has luminance zero and white has luminance one. Against a fixed background L, the black contrast is (L+0.05)/0.05=1+20L. The white contrast is 1.05/(L+0.05)=21/(1+20L).
Both expressions are positive on the entire interval. They are equal when (1+20L)²=21. The sole solution in [0,1] is L=(√21−1)/20, approximately 0.1791.
The black expression increases with L and the white expression decreases. For luminance below the threshold the white ratio is greater. For luminance above it the black ratio is greater, and each gives √21 at equality.
At L=0 the black ratio is one and the white ratio is twenty-one. At L=1 those ratios reverse, confirming the two end cases. This calculation compares one stated contrast quantity for a uniform background and uses no assumptions about type size, texture or color perception. See [The luminance contrast ratio](https://www.w3.org/TR/WCAG22/#dfn-contrast-ratio). The given metric fixes two monotone expressions in background luminance. Their sole crossing determines the preferred mathematical ratio.
Find the natural frequencies of an ideal fixed string
Take a separated sinusoidal displacement u(x,t)=X(x)A(t) with positive spatial wave number k and X″+k²X=0. The string endpoints require X(0)=X(ℓ)=0. The general spatial form is b cos(kx)+d sin(kx).
The condition at zero sets b=0. A nonzero mode needs d≠0 and sin(kℓ)=0, hence kℓ=nπ for some positive integer n. The zero wave-number spatial solution is linear, and two zero boundary values would make it identically zero.
Substituting u into the wave equation gives A″+c²k²A=0. Thus the angular frequency is ck in radians per second and the ordinary frequency is ck/(2π)=nc/(2ℓ). This has units of inverse seconds because c is length per time.
For each n≥1 the spatial factor sin(nπx/ℓ) and any nonzero sinusoidal temporal solution at that frequency satisfy both boundary conditions. In the ideal model the frequencies are integer multiples of c/(2ℓ), with no damping or end motion assumed. See [Fixed-end modes of an ideal vibrating string](https://openstax.org/books/university-physics-volume-1/pages/16-6-standing-waves-and-resonance). The fixed endpoints impose an integer number of half-wavelengths. The temporal equation gives radians per second before conversion to hertz.
Divide an octave into equal frequency ratios
Let r>0 be the common ratio for adjacent steps. After d steps, the frequency ratio is rᵈ. An octave in this model is a ratio of two, so rᵈ=2 for a positive integer d.
The positive solution is r=2^(1/d), unique because the dth power strictly increases on positive reals. Moving k signed steps multiplies f₀ by rᵏ, where a negative step uses the inverse ratio.
Consequently the frequency at integer index k is f_k=f₀·2^(k/d). For any index, f_(k+d)=2f_k. Two notes separated by any fixed number of steps have the same frequency ratio even though their frequency difference depends on the starting frequency.
Define cents of a positive ratio R by 1200 log₂ R. One step gives 1200/d cents, and an interval of k steps gives 1200k/d cents. This is a logarithmic interval measure, so a fixed cents difference means a fixed ratio. See [Ratios, cents and a fifth-octave discrepancy](https://quadriviumpress.com/physicsOfMusic/ch-09-musical-scales-and-tuning-systems/). The octave equation uses a positive frequency ratio. The logarithmic cents measure then gives the step size for any declared number of steps.
Compare exact fifths with exact octaves
The ratio from m exact fifths is (3/2)ᵐ, where m is a positive integer. If it were 2ⁿ for an integer n, the left side is greater than one and thus n would be positive.
Multiplying by 2ᵐ would give 3ᵐ=2^(m+n). The left side is divisible by three and the right side is a power of two. Unique factorization rules out equality.
For twelve fifths and seven octaves the ratio of the starting-frequency multipliers is (3/2)¹²/2⁷=3¹²/2¹⁹=531441/524288.
Cents are logarithmic, so adjacent intervals add in cents while frequency ratios multiply. Equal temperament makes a fifth exactly 700 cents.
| Quantity | Exact result |
|---|---|
| Just net ratio | 531441/524288 |
| Just net cents | 23.46001 |
| 12-TET net cents | 0 |
| 12-TET net ratio | 2^(0/1200) |
| Exact just cents expression | 1200 log₂(531441/524288) |
Exact inputs and supporting calculations
| Parameter | Value |
|---|---|
| f | 12 |
| o | 7 |
Since the numerator is larger by 7153, the twelve fifths finish at a slightly higher frequency. This finite ratio is compatible with the impossibility of closing both exact steps, and the argument does not make a claim about how a musical performance should tune them. See [Ratios, cents and a fifth-octave discrepancy](https://quadriviumpress.com/physicsOfMusic/ch-09-musical-scales-and-tuning-systems/). Coprime frequency powers prevent exact alignment of positive fifth steps with octaves. The integer numerator and denominator give a positive finite excess.
Find a nearest step on a logarithmic pitch grid
Let f be the positive target frequency and x=d log₂(f/f₀) its step coordinate even when x is not an integer. A grid choice k has logarithmic difference 1200 log₂(f_k/f)=(1200/d)(k−x) cents.
The positive factor 1200/d does not affect which absolute value is smallest. Among all integer k, the minimum of |k−x| occurs at a nearest integer. Integers outside the two neighbors ⌊x⌋ and ⌈x⌉ are farther away.
If the fractional part of x is below one half, choose ⌊x⌋, and if it is above one half, choose ⌈x⌉. An exact integer is a zero-error choice. At half an integer the two neighbors tie, and a deterministic rule may select the upper integer.
The crossover between adjacent positive grid frequencies f_k and f_(k+1) occurs at their geometric mean when comparing absolute cents, since their logarithms average. For absolute differences in hertz it would occur at their arithmetic mean. Those quantities differ for distinct positive notes. See [Ratios, cents and a fifth-octave discrepancy](https://quadriviumpress.com/physicsOfMusic/ch-09-musical-scales-and-tuning-systems/). Minimizing absolute cents is rounding in a logarithmic coordinate. An absolute hertz criterion puts the boundary at a different mean.
Derive the beat envelope for two tones
Set A=2πf₁t and B=2πf₂t. The sum formula for cosines gives cos A+cos B=2 cos((A−B)/2) cos((A+B)/2). These arguments are expressed in radians.
The sum is therefore 2 cos(π(f₁−f₂)t) cos(2π((f₁+f₂)/2)t). The carrier oscillates at the mean of the two frequencies. The signed multiplier can change sign, while its absolute value gives the product envelope magnitude.
If Δ=|f₁−f₂|>0, the absolute envelope reaches its value two when πΔt is an integer multiple of π. Consecutive such maxima are separated by 1/Δ seconds, so the envelope peak rate is Δ hertz.
If the frequencies are equal, the multiplier is constantly two and there is no spacing between distinct envelope peaks to compute. The formula describes two ideal equal-amplitude tones with the given phase, and the envelope need not be perceived as slow beats when the frequencies are widely separated. See [Two nearby frequencies and their beat envelope](https://openstax.org/books/university-physics-volume-1/pages/17-6-beats). The sum-to-product identity separates the carrier and signed modulation. Peaks of the absolute envelope determine the stated beat rate.
Count coincidences in an ideal polyrhythm cycle
Use the onset times jT/m for 0≤j<m and kT/n for 0≤k<n, with m,n positive integers. A shared onset satisfies jn=km after cancelling the common positive period.
Let g=gcd(m,n) and write m=ga and n=gb with a,b coprime. The equality j b=k a forces a to divide j and b to divide k. Every such solution has j=aℓ and k=bℓ for an integer ℓ.
The allowed indices give 0≤ℓ<g, and their shared times are ℓT/g. Each time occurs exactly once on either original list, so there are g shared onsets including zero.
Counting both lists and subtracting the g duplicates gives m+n−g distinct onsets. The two lists can also be placed on the T/lcm(m,n) grid, while their intersection is the coarser T/g grid. The endpoint T starts the next cycle. See [Cyclic onset patterns and evenness](https://erikdemaine.org/papers/DeepRhythms_CGTA/paper.pdf), [Find the greatest common measure](https://mathcs.clarku.edu/~djoyce/java/elements/bookVII/propVII2.html). A cyclic grid and a common start turn overlapping onsets into a divisibility equation. The gcd counts the common positions before the endpoint.
Spread integer accents around a cyclic grid
For integer counts n≥1 and 0≤k≤n, define h_i=⌊(i+1)k/n⌋−⌊ik/n⌋ for every integer i. Since 0≤k/n≤1, each difference is either zero or one. Adding n to both floor inputs adds the same integer k, so h_(i+n)=h_i.
The sum over a full cycle telescopes to ⌊nk/n⌋−⌊0⌋=k. Thus the binary pattern gives exactly the specified number of accents in n positions.
For any nonnegative integer length L and starting index i, the window count telescopes to ⌊(i+L)k/n⌋−⌊ik/n⌋. Write ik/n as its floor plus fractional part u∈[0,1). The count is then ⌊u+Lk/n⌋.
It follows that each window of length L has either ⌊Lk/n⌋ or ⌈Lk/n⌉ accents, with just one value when Lk/n is integral. The periodic extension makes this true for windows crossing the cycle boundary and covers the uniform all-zero and all-one cases. See [Cyclic onset patterns and evenness](https://erikdemaine.org/papers/DeepRhythms_CGTA/paper.pdf), [Round down to the lower integer](https://www.ocw.mit.edu/courses/6-042j-mathematics-for-computer-science-spring-2015/mit6_042js15_textbook2.pdf#page=41). The floor-difference construction preserves the exact number of accents. A telescoping calculation bounds each cyclic window by its adjacent integer counts.
Compute the RMS of a finite harmonic sum
Write f(t)=a₀+∑ from k=1 to K of [a_k cos(2πkt/T)+b_k sin(2πkt/T)]. Its squared RMS is the average of f(t)² over one period T>0.
For each nonzero integer k, the mean of exp(2πikt/T) over the period is zero by direct integration. Expressing sines and cosines through these exponentials shows that each nonconstant term has zero mean, and products of terms with different positive indices have zero mean.
For a fixed positive index, the mean of sine times cosine is zero. The means of sine squared and cosine squared are each one half, from the identities involving the double angle. The constant squared term has mean a₀².
Consequently the squared RMS is a₀²+½∑ from k=1 to K of (a_k²+b_k²). Take the nonnegative square root in the same units as f. This addition of squares uses averaging over an entire period and distinct harmonics of that period. See [Harmonic orthogonality over a complete period](https://ocw.mit.edu/courses/18-085-computational-science-and-engineering-i-fall-2008/f1da5a16ff5dfd980ef4dfeb46bd76b7_cse41.pdf). Continuous harmonic orthogonality removes mixed terms from a complete-period mean square. The constant and the two kinds of sinusoidal terms have distinct weights.
Cancel even harmonics with half-period sign reversal
For integer k define the complex coefficient c_k as the period mean of f(t) exp(−2πikt/T). The assumed integrability makes this integral finite, since the exponential factor has modulus one.
Split the integral over [0,T] into two equal halves. Substitute t=s+T/2 in the second half. The waveform there is −f(s), and the exponential is exp(−2πiks/T) multiplied by exp(−πik)=(−1)^k.
The full coefficient is therefore (1−(−1)^k)/T times the integral over the first half. Every even k gives zero, including k=0, so the mean and all even-index harmonic coefficients vanish.
For odd k the coefficient is twice the appropriately scaled first-half integral and may also be zero depending on f. This argument establishes the cancellation directly and requires no pointwise convergence of a Fourier series. See [Harmonic orthogonality over a complete period](https://ocw.mit.edu/courses/18-085-computational-science-and-engineering-i-fall-2008/f1da5a16ff5dfd980ef4dfeb46bd76b7_cse41.pdf). Translating the second half contributes a sign and a harmonic-dependent phase. The prefactor cancels for every even index.
Show why sampled complex harmonics form a basis
For m between zero and n−1, let v_m have entries exp(2πimj/n) for j from zero to n−1. Use the inner product ⟨x,y⟩=(1/n)∑ x_j conj(y_j), linear in the first argument.
The inner product of v_m and v_l reduces to (1/n)∑ q^j, where q=exp(2πi(m−l)/n). If m=l, all terms are one and the vectors have unit norm.
For m≠l in the index range, q≠1 and qⁿ=1. The geometric sum is (1−qⁿ)/(1−q)=0, giving orthogonality. For n=1 there is only the constant vector and no distinct-index condition.
These n orthonormal vectors are a basis for the n-dimensional complex sample space. For any sample vector x, the coefficient of v_m is ⟨x,v_m⟩=(1/n)∑ x_j exp(−2πimj/n). Summing coefficient times basis vector recovers every sample. See [A Fourier basis from complex roots of unity](https://theory.stanford.edu/~blynn/linear/dft.html). The finite geometric sum makes distinct Fourier basis columns orthogonal. A declared normalized inner product fixes the factor in coefficient recovery.
Find exact aliases on a uniform sampling grid
With sampling rate f_s>0, the sample time at integer j≥0 is j/f_s. A unit complex tone at frequency f produces samples exp(2πifj/f_s), starting at value one.
If f−g is an integer multiple of f_s, then exp(2πi(f−g)j/f_s)=1 for every integer j. The tone at f and the tone at g are therefore identical at the sample times.
Conversely, if the complex sample sequences coincide, compare the samples at j=1. Equality of those complex exponentials forces (f−g)/f_s to be an integer. Thus the complex aliases are exactly the frequencies in the same residue class modulo f_s.
Adding a multiple of the sample rate changes integer sample phases by full revolutions. Negating frequency also preserves cosine. A subset of coincident samples without this relationship does not give equality at every index.
| Quantity | Exact result |
|---|---|
| Residue f mod Fs | 1 |
| Residue g mod Fs | 7 |
| Equal up to sign | True |
| First displayed mismatch | None; all indices agree |
| Exact reflection, shift, or mismatch | Reflected congruence: 7≡−1 (mod 8). |
Exact inputs and supporting calculations
| Parameter | Value |
|---|---|
| Fs | 8 |
| f | 1 |
| g | 7 |
| n | Exact cosine f | Exact cosine g | Agree? |
|---|---|---|---|
| 0 | 1 | 1 | True |
| 1 | √2/2 | √2/2 | True |
| 2 | 0 | 0 | True |
| 3 | −√2/2 | −√2/2 | True |
| 4 | −1 | −1 | True |
| 5 | −√2/2 | −√2/2 | True |
| 6 | 0 | 0 | True |
| 7 | √2/2 | √2/2 | True |
For zero-phase real cosine samples, equality at j=1 means the two angles agree up to sign and a whole turn. Either f−g or f+g is therefore an integer multiple of f_s. Each condition suffices for every j, using periodicity and evenness of cosine. See [Aliases on a discrete time grid](https://sigproc.mit.edu/_static/fall25/lectures/Sampling_and_Aliasing-handout.pdf). With fixed spacing, integer-frequency shifts preserve complex samples. Zero-phase real cosines also admit the sign symmetry.
Bound nearest-level quantization error
Let Δ=1/(m−1), so the allowed levels are 0,Δ,…,(m−1)Δ=1. Scale the input to y=x/Δ∈[0,m−1]. The nearest integer with half ties upward is j=⌊y+1/2⌋.
The output Q(x)=jΔ uses an allowed index, since y+1/2 ranges from 1/2 through m−1/2. Its floor lies between zero and m−1 inclusive.
From j≤y+1/2<j+1, obtain −1/2<j−y≤1/2. It follows that |Q(x)−x|≤Δ/2. This is at most the distance to any other level because j is a nearest integer to the scaled coordinate.
At a midpoint x=(l+1/2)Δ between adjacent levels, the upward choice has difference Δ/2. Thus the bound is sharp, equal to 1/[2(m−1)]. The model assumes the input is already within the declared interval. See [Amplitude quantization on a finite scale](https://ocw.mit.edu/courses/6-003-signals-and-systems-fall-2011/95b4b245722073e5d0c4ea95b384446e_MIT6_003F11_lec22.pdf). A finite choice of amplitude levels needs a declared tie rule. Nearest-level selection has exact half-step error at an interior midpoint.
Smooth a repeating row while preserving its mean
Write y_i=(x_(i−1)+2x_i+x_(i+1))/4 with every index interpreted modulo n. For constant x_i=c this expression gives c at every position, since the three weights sum to one.
In the sum over one full cycle, each of the sequences shifted by one index has the same sum as the original. Thus ∑ y_i=∑ x_i and the mean is unchanged. This includes a one-position cycle with repeated neighbor indices.
Each y_i is a convex combination of three real values. If all original values lie in a closed interval, then every averaged value lies in that same interval. The same argument bounds each output by the minimum and maximum of its three contributing samples.
For x_i=A(−1)^i on an even-length cycle, each neighbor has sign opposite to x_i, including across the joined ends. Its output is (−x_i+2x_i−x_i)/4=0. A constant added to this alternating pattern survives by linearity. See [Nearest-site regions and affine interpolation](https://graphics.stanford.edu/courses/cs205a-13-fall/assets/notes/cs205a_notes.pdf#page=168). Nonnegative weights preserve a local range. The proof uses cyclic index shifts to preserve the mean and opposite neighboring signs to remove alternation.
Bound the error of replacing a smooth curve by chords
Let L(t) be the straight interpolation between B(a) and B(b), and assume a<b. Put E(t)=B(t)−L(t), so E(a)=E(b)=0 and E″=B″. Fix an interior point t₀ with E(t₀)≠0.
Choose the unit vector e=E(t₀)/‖E(t₀)‖ and the scalar function z(t)=e·E(t). Then z(t₀)=‖E(t₀)‖, z(a)=z(b)=0 and z″(t)≥−M by the norm bound.
Let q(t)=(M/2)(t−a)(b−t). Since q″=−M, z−q has nonnegative second derivative and zero endpoint values. Convexity makes z−q nonpositive between the endpoints. Evaluating at t₀ gives ‖E(t₀)‖≤q(t₀).
The quadratic q is at most M(b−a)²/8 at the midpoint. The inequality also holds when E(t₀)=0 and at both endpoints. A scalar example B=q with its zero chord attains the bound for positive M, and the comparison uses the same parameter on curve and chord. See [A second-derivative chord interpolation bound](https://biswarupbiswas.github.io/numerical-methods/lectures/lec28-interpolation-error/), [Norm definitions and finite-dimensional comparison](https://web.stanford.edu/~boyd/cvxbook/bv_cvxbook.pdf#page=649). Project the vector deviation in its own direction. A scalar convexity estimate then bounds the matched-parameter distance to the chord.
Round a shallow line to grid rows
At an integer x, put r_x=⌊mx+b+1/2⌋. The floor inequality gives −1/2<r_x−(mx+b)≤1/2. This bounds the vertical error by half a row and chooses the upper row at a half tie.
For consecutive column coordinates, the two inputs to the floor function differ by m. Write A=mx+b+1/2. Because A−1≤A+m≤A+1, monotonicity gives ⌊A⌋−1≤⌊A+m⌋≤⌊A⌋+1.
Thus |r_(x+1)−r_x|≤1. Consecutive chosen grid points are horizontal neighbors when the row agrees and diagonal neighbors when the row changes.
The half-row bound is attained for a line passing halfway between two rows in a sampled column. The argument uses vertical error and the assumption |m|≤1. A steep line may use a different sampled axis if the same step bound is desired. See [Round down to the lower integer](https://www.ocw.mit.edu/courses/6-042j-mathematics-for-computer-science-spring-2015/mit6_042js15_textbook2.pdf#page=41). A specified floor formula makes nearest-row ties reproducible. The slope restriction limits consecutive rounded row changes.
Find the self-similar rectangle ratio
Let r=w/h>1. After removing a square of side h, the remaining sides are w−h and h. Similarity after turning means that the former height h becomes the new longer side and the old leftover width becomes the new shorter side.
The similarity relation is w/h=h/(w−h), or r=1/(r−1). Thus r²−r−1=0. The two roots are (1±√5)/2 and only the positive root φ=(1+√5)/2 exceeds one.
This value is below two, so h>w−h as required by the turned orientation. The new longer side h equals w/φ, and the new shorter side is h/φ, since the aspect ratio is unchanged.
Repeating the removal and turn produces longer side lengths wφ⁻ʲ at stage j and areas wh φ⁻²ʲ. The exact proportion follows from the stipulated self-similarity. Other design preferences do not enter the equation. See [A line cut into two related lengths](https://mathcs.clarku.edu/~djoyce/java/elements/bookII/propII11.html). The related geometric construction equates a rectangle to a square. The lesson’s similarity equation gives the unique valid aspect ratio and scale factor.
Track area through a recursive triangle design
At stage zero the solid equilateral triangle has area A₀=√3/4. Each refinement keeps three smaller triangles, each with half the parent side, and their interiors are pairwise disjoint.
After n steps there are 3ⁿ triangles and each side length is 2⁻ⁿ. Each area equals A₀·4⁻ⁿ because two linear dimensions each scale by 2⁻ⁿ.
The total area is A₀(3/4)ⁿ. Shared boundaries are line segments or points of zero area, so they do not change the total. The compact stage sets are nested, and original vertices remain in each stage.
The limit set is the intersection of these nested stage sets. By continuity of planar area for a decreasing sequence with finite initial area, its area equals the limit of the stage areas. That limit is zero although the set retains points. See [Nested triangle construction and a covering exponent](https://warwick.ac.uk/fac/sci/maths/people/staff/mark_pollicott/p1/main46-short.pdf). The nested refinement keeps three half-side triangles with disjoint interiors. Continuity of finite planar area gives the exact limiting area.
Find the box-counting exponent of the recursive triangle
At stage n, let r=2⁻ⁿ. Each of the 3ⁿ equilateral triangles has diameter r and can be covered by one closed disk of radius r centered at one of its vertices. Their union contains the limiting set, so N(r)≤3ⁿ.
Every stage triangle contains at least one retained vertex that remains in all deeper stages. A collection of disks covering the limiting set must therefore include, for every stage triangle, a disk meeting that triangle, even when a retained vertex is shared by two triangles.
If a radius-r disk meets a given stage triangle, the triangle lies within radius 2r of that disk’s center, by its diameter bound. The triangle interiors are disjoint and their areas are √3·r²/4. One disk thus meets at most 16π/√3 triangles, in particular no more than thirty.
Consequently 3ⁿ/30≤N(2⁻ⁿ)≤3ⁿ. Taking logarithms and dividing by n log 2 gives a limit log 3/log 2. For intermediate radii, monotonicity places N(r) between the adjacent dyadic counts, giving the same limit of log N(r)/log(1/r). See [Nested triangle construction and a covering exponent](https://warwick.ac.uk/fac/sci/maths/people/staff/mark_pollicott/p1/main46-short.pdf). Each disk can meet only a bounded number of stage triangles at matched scales. That bound and a direct cover give the exact limiting exponent.
Fit a symbol to corresponding points
Let the source and target vectors be x_i and y_i for i=1,…,N. Their means are x̄ and ȳ. For a proposed scale s≥0 and translation t, write each residual as a centered residual (y_i−ȳ)−s(x_i−x̄) plus the common vector ȳ−s x̄−t.
The centered residuals sum to zero. Expanding squared norms removes their cross terms with the common vector, so the residual total splits into a centered sum and N‖ȳ−s x̄−t‖². For fixed s this is minimized uniquely by t=ȳ−s x̄.
The remaining sum is A s²−2B s+C, where A=∑‖x_i−x̄‖² and B=∑(x_i−x̄)·(y_i−ȳ). At least two distinct source points give A>0. Completing the square identifies B/A as the unrestricted minimizer.
Under s≥0 the minimizing scale is max(0,B/A), since it is the nonnegative number nearest to B/A. If B≤0 the optimum collapses the mapped points to their translated mean. Holding orientation fixed is part of the fitting problem. See [Least-squares intercept and slope through centered data](https://www.itl.nist.gov/div898/handbook/pmd/section4/pmd431.htm). Eliminate translation by centering paired points. Completing the remaining quadratic identifies the nonnegative optimal scale and its collapse case.
Compute exact shape transformations, curve splits, geometric compatibility and sampled audio relationships.
Compute oriented area after an exact drawing transform
Double the oriented area
The signed doubled area is the determinant of the two side vectors. Applying T to both vectors multiplies this determinant by det T.
| Quantity | Exact result |
|---|---|
| Original vertices | (0, 0), (1, 0), (0, 2) |
| Transformed vertices | (0, 0), (2, 0), (0, 2) |
| Signed doubled area before | 2 |
| Signed doubled area after | 4 |
| Determinant | 2 |
| Ordinary unsigned area before and after | 1 and 2 |
Exact inputs and supporting calculations
| Parameter | Value |
|---|---|
| T | [[2,0],[0,1]] |
| pts | [[0,0],[1,0],[0,2]] |
Track both steps of a glide reflection
A two-unit positive glide
Horizontal translation commutes with reflection in a horizontal line. Squaring their composition cancels the reflections and adds the translations.
| Quantity | Exact result |
|---|---|
| First image | (2, -1) |
| Second image | (4, 3) |
| Net translation | (4, 0) |
| Pure reflection | False |
Exact inputs and supporting calculations
| Parameter | Value |
|---|---|
| k | 1 |
| h | 2 |
| P | [0,3] |
Test whether regular polygon angles fit at a vertex
Alternating triangle and hexagon angles fit
Every interior angle of a regular n-gon is 180(n−2)/n degrees. Local equality to 360 degrees is necessary for a flat edge-to-edge tiling; it does not prove a global tiling for arbitrary mixed patterns.
| Quantity | Exact result |
|---|---|
| Interior angles | 60°, 120°, 60°, 120° |
| Total | 360° |
| Angular gap | 0° |
| Local angle condition | True |
Exact inputs and supporting calculations
| Parameter | Value |
|---|---|
| n | [3,6,3,6] |
Subdivide a quadratic Bézier by exact interpolation
Split a symmetric quadratic at one-half
At each level interpolate endpoints with weights 1−t and t. The outer two edges of the interpolation triangle give the exact control polygons of the two Bézier pieces.
| Quantity | Exact result |
|---|---|
| Q₀ | (1, 2) |
| Q₁ | (3, 2) |
| Split point | (2, 2) |
| Left control polygon | (0, 0) → (1, 2) → (2, 2) |
| Right control polygon | (2, 2) → (3, 2) → (4, 0) |
Exact inputs and supporting calculations
| Parameter | Value |
|---|---|
| P | [[0,0],[2,4],[4,0]] |
| t | 1/2 |
Compare repeated fifths and octaves as exact ratios
Twelve fifths versus seven octaves
Cents are logarithmic, so adjacent intervals add in cents while frequency ratios multiply. Equal temperament makes a fifth exactly 700 cents.
| Quantity | Exact result |
|---|---|
| Just net ratio | 531441/524288 |
| Just net cents | 23.46001 |
| 12-TET net cents | 0 |
| 12-TET net ratio | 2^(0/1200) |
| Exact just cents expression | 1200 log₂(531441/524288) |
Exact inputs and supporting calculations
| Parameter | Value |
|---|---|
| f | 12 |
| o | 7 |
Identify identical samples under frequency changes
Opposite frequency residues are cosine aliases
Adding a multiple of the sample rate changes integer sample phases by full revolutions. Negating frequency also preserves cosine. A subset of coincident samples without this relationship does not give equality at every index.
| Quantity | Exact result |
|---|---|
| Residue f mod Fs | 1 |
| Residue g mod Fs | 7 |
| Equal up to sign | True |
| First displayed mismatch | None; all indices agree |
| Exact reflection, shift, or mismatch | Reflected congruence: 7≡−1 (mod 8). |
Exact inputs and supporting calculations
| Parameter | Value |
|---|---|
| Fs | 8 |
| f | 1 |
| g | 7 |
| n | Exact cosine f | Exact cosine g | Agree? |
|---|---|---|---|
| 0 | 1 | 1 | True |
| 1 | √2/2 | √2/2 | True |
| 2 | 0 | 0 | True |
| 3 | −√2/2 | −√2/2 | True |
| 4 | −1 | −1 | True |
| 5 | −√2/2 | −√2/2 | True |
| 6 | 0 | 0 | True |
| 7 | √2/2 | √2/2 | True |
Worked examples
Scale and rotate an outlined triangle
Transform the triangle with vertices (0,0),(3,0),(0,2) by rotating a quarter turn counterclockwise, scaling by two and adding (1,−1). Give its image vertices and area.
- The quarter turn sends (x,y) to (−y,x). Scaling by two and adding (1,−1) gives the combined map (x,y)↦(1−2y,2x−1).
- Applying this map to the original vertices gives (1,−1), (1,5) and (−3,−1), in that order. The image of the origin is the translation vector.
- The original perpendicular sides have lengths three and two, so the old area is three square coordinate units. Rotation leaves that area unchanged, and the scaling multiplies it by four.
- As a direct check, the two perpendicular image sides from (1,−1) have lengths six and four. The image area is their product divided by two, which is twelve square coordinate units.
The transformed vertices are (1,−1),(1,5),(−3,−1), with area twelve square units.
Check the order of two reflections
Reflect (2,1) first in the horizontal x-axis and then in the line y=x. Give the intermediate point, final point and the equivalent rotation.
- Reflection in the horizontal axis fixes the first coordinate and reverses the second. Starting at (2,1), the intermediate point is therefore (2,−1).
- Reflection in the line y=x interchanges the coordinates, since that line’s parallel component is unchanged and its normal component changes sign. The second image is (−1,2).
- For arbitrary (x,y) the composition gives (x,y)↦(x,−y)↦(−y,x). This is the standard quarter turn counterclockwise about the origin.
- The formula also follows because the oriented angles of the two axes are zero and π/4. Twice their difference is π/2, consistent with applying the horizontal reflection first.
The two images are (2,−1) and (−1,2). The net rotation is a quarter turn counterclockwise.
Check a repeating design under a basis change
For u=(2,0) and v=(1,3), compare the basis (u,v) with (u+v,v). Show each generates the same lattice and give both cell areas.
- The original basis has columns u=(2,0) and v=(1,3). The proposed first column is u+v=(3,3), and the second remains v.
- Both new columns are integer combinations of the old ones. Conversely u=(u+v)−v is an integer combination of the new columns, and v is already one. The two sets of lattice points are equal.
- The determinant of the original basis is 2·3−0·1=6. The new determinant is 3·3−3·1=6, so the two cell areas are both six square coordinate units.
- In coefficient coordinates the basis change has columns (1,1) and (0,1), giving determinant one. This explains the unchanged cell area and the reversible integer-coordinate description.
The two bases generate the same lattice, and each cell has area six.
Project two points and find their vanishing point
Use focal distance 2 and the line (1,2,4)+t(3,−1,2). Compute the projected points at t=0 and t=1 and the limit as t grows.
- At t=0 the space point is (1,2,4), of positive depth four. Multiplying each transverse coordinate by 2/4 gives the image (1/2,1).
- At t=1 the space point is (4,1,6). Its image is (8/6,2/6)=(4/3,1/3). Depth has increased and is still positive.
- The general image has coordinates 2(1+3t)/(4+2t) and 2(2−t)/(4+2t). Dividing numerator and denominator by t shows the limiting image is (3,−1).
- The finite limit also comes from the direction ratios 2·3/2=3 and 2·(−1)/2=−1. The two sample images differ, giving a nonconstant projected line on the visible depth range.
The images are (1/2,1) and (4/3,1/3), with vanishing point (3,−1).
Split a symmetric quadratic curve
Use controls (0,0),(2,4),(4,0). Split at a=1/2 and give the two control triples. Verify where the two resulting curves meet.
- At a=1/2 the first interpolation between controls (0,0) and (2,4) gives U=(1,2). The interpolation between (2,4) and (4,0) gives V=(3,2).
- The midpoint of U and V is W=(2,2). Evaluating the original quadratic at t=1/2 gives weights 1/4, 1/2 and 1/4, yielding the same W.
- The left controls are (0,0),(1,2),(2,2). The right controls are (2,2),(3,2),(4,0). Each triple uses the corresponding original endpoint and the shared split endpoint.
- The final point of the left curve equals the initial point of the right curve, namely (2,2). Each one-sided derivative in its own half-interval parameter is (2,0), using twice the adjacent control difference.
The left controls are (0,0),(1,2),(2,2), and the right controls are (2,2),(3,2),(4,0). They meet at (2,2).
Fit a 16-to-9 crop inside an image
Use a 1200-by-900 pixel rectangle. Find the dimensions and area of the largest axis-aligned crop with width-to-height ratio 16/9, and find the area omitted.
- The source width is 1200 pixels and height is 900 pixels. If a crop used the full height, its required width would be (16/9)·900=1600, which exceeds 1200.
- Thus the width is the limiting dimension. Taking width 1200 gives height 1200·9/16=675 pixels, and this is within the original height.
- The resulting area is 1200·675=810000 square pixels. The starting area is 1200·900=1080000, so the omitted area is 270000 square pixels.
- Every largest crop must use that width and height and occupy the full horizontal extent. Its vertical placement can vary through 225 pixels within the rectangle, with integer positions if the crop is aligned to pixel rows.
The largest crop is 1200 by 675 pixels, with area 810000 and omitted area 270000 square pixels.
Combine three linear color layers
Place red at opacity 1/4 over green at opacity 1/2 over opaque blue. For unit channel primaries in linear RGB, find the combined opacity and channel vector.
- Opaque blue has premultiplied channels (0,0,1) and opacity one. Half-opaque green has premultiplied channels (0,1/2,0).
- Green over blue adds half of the blue channels to its own, producing (0,1/2,1/2). The new opacity is 1/2+(1/2)·1=1.
- The top red has premultiplied channels (1/4,0,0) and leaves uncovered fraction 3/4. It contributes its own channels plus three quarters of (0,1/2,1/2), giving (1/4,3/8,3/8).
- The final opacity is 1/4+(3/4)·1=1, so its premultiplied and ordinary channel values coincide. The output is stated in the declared linear RGB coordinates.
The opacity is one and the linear channel vector is (1/4,3/8,3/8).
Compare a seven-step octave division with a pure fifth
Starting at 440 Hz in a twelve-step equal-ratio system, find the seven-step frequency. Compare it with the frequency obtained by a 3/2 ratio and express the signed cents difference.
- The ratio after seven steps in a twelve-step octave is 2^(7/12). The frequency from 440 Hz is 440·2^(7/12) Hz, approximately 659.255 Hz.
- A pure ratio of 3/2 gives 440·(3/2)=660 Hz. Hence the equal-ratio note is about 0.745 Hz lower for this reference frequency.
- The logarithmic interval is 700 cents in the equal-ratio case. The pure interval is 1200 log₂(3/2), approximately 701.955 cents.
- The signed difference, equal-ratio interval minus pure interval, is 700−1200 log₂(3/2), approximately −1.955 cents. That cents difference compares ratios and would be the same at a different positive reference frequency.
The equal-ratio tone is approximately 659.255 Hz, while the pure fifth is 660 Hz. The signed interval difference is approximately −1.955 cents.
Find the envelope of two nearby tones
For unit cosines at 440 and 444 Hz with zero starting phase, find the carrier frequency, envelope factor and the spacing between envelope maxima.
- The sum and difference of the stated frequencies are 884 Hz and 4 Hz. Their mean is 442 Hz, which is the carrier frequency in the product representation.
- Using the two-cosine identity gives 2 cos(4πt) cos(884πt), with t in seconds and angular arguments in radians. The sign of the difference can be reversed inside cosine.
- The envelope magnitude is 2|cos(4πt)|. Its value equals two when 4πt is an integer multiple of π, so the maxima occur at t=k/4 seconds.
- Consecutive envelope maxima are one quarter of a second apart, or four per second. This is the envelope result for the stated equal amplitudes and zero initial phases.
The carrier is 442 Hz. The envelope is 2|cos(4πt)| and its peaks are 1/4 second apart.
Draw three and four onsets on one cycle
Write the three-beat and four-beat equally spaced onset positions as ticks on a twelve-tick cycle. Count the distinct and shared ticks.
- On a twelve-tick period, three equal spacings use every fourth tick, which yields {0,4,8}. Four equal spacings use every third tick, which yields {0,3,6,9}.
- The only tick in both sets is zero. Tick twelve represents the next period’s zero and is outside this period’s tick set.
- The union is {0,3,4,6,8,9}, containing six onsets. The count also comes from 3+4−1=6, because exactly one onset was counted twice.
- The shared count one equals gcd(3,4), and the twelve ticks give lcm(3,4) equal subdivisions of the cycle. Both schedules start at tick zero.
The two schedules use {0,4,8} and {0,3,6,9}. They share one tick and have six distinct ticks.
Check aliases in an eight-sample period
With sampling rate eight samples per second, compare zero-phase cosine sequences of 1, 7 and 9 Hz. Give the first three samples for each and explain the shared values.
- For a sample index j the three angles are 2πj/8, 2π·7j/8 and 2π·9j/8. The last equals the first plus 2πj, which gives the same cosine.
- The angle for 7 Hz equals 2πj−2πj/8. By full-turn periodicity and evenness of cosine, it also gives the same cosine at every integer sample index.
- At j=0,1,2 the common values are cos 0=1, cos(π/4)=√2/2 and cos(π/2)=0. These exact values apply to all three sampled sequences.
- The frequencies obey 9−1=8 and 7+1=8. The first relation is a discrete shift by a sampling rate, while the second uses the extra sign ambiguity for real zero-phase cosine samples.
All three begin with 1,√2/2,0 and give identical cosine samples on this grid.
Fit an exact scale and translation to three marks
Fit source (0,0),(2,0),(0,2) to target (1,2),(5,2),(1,6) in that order, allowing only nonnegative scale and translation. Give the parameters and residual total.
- The first source point is zero, so mapping it to the first target requires translation (1,2). After removing that translation the other target vectors are (4,0) and (0,4).
- The corresponding nonzero source vectors are (2,0) and (0,2). They are both multiplied by two in the target. This provides a scale of two with the same translation for all three points.
- Each residual is exactly zero, which gives the global least possible residual total because each summand is a squared norm. Distinct source points force the same scale in any zero-residual solution.
- As a check from the fitted means, x̄=(2/3,2/3) and ȳ=(7/3,10/3). Subtracting twice x̄ from ȳ gives (1,2). The scale is positive and satisfies the nonnegativity constraint.
The scale is two and the translation is (1,2), with zero squared residual.
Try it yourself
Apply (x,y)↦(x+2y,y) to the rectangle with vertices (0,0),(3,0),(3,1),(0,1). Give the transformed vertices and area.
Show the answer and reasoning
The image vertices are (0,0),(3,0),(5,1),(2,1), and the area is three.
The shear leaves y unchanged and adds twice y to x. The transformed corners in the stated order are (0,0),(3,0),(5,1),(2,1). The bottom side remains a horizontal segment of length three. The upper side has the same length, lies at height one and is shifted two units to the right. The resulting region is a parallelogram with perpendicular height one. Its area is 3·1=3 square coordinate units. The linear matrix has columns (1,0) and (2,1), so its determinant is one. The signed area keeps its sign and magnitude, matching the direct area calculation.
Reflect first in x=1 and then in x=4. Derive the net map and its effect on (2,−1).
Show the answer and reasoning
The map is (x,y)↦(x+6,y), sending (2,−1) to (8,−1).
Reflection across x=1 sends (x,y) to (2−x,y). Reflection across x=4 then sends a point with first coordinate u to first coordinate 8−u. Composing in this order gives 8−(2−x)=x+6. The second coordinate does not change at either reflection. The input (2,−1) first becomes (0,−1) and then becomes (8,−1). These are both obtained by reflection through the named vertical line. The total translation vector is (6,0), twice the separation of the reflecting lines in the positive x direction. The order of the reflections determines this direction.
Use G(x,y)=(x+3,−y). Find G² and decide whether G has a fixed point.
Show the answer and reasoning
G²(x,y)=(x+6,y). There is no fixed point of G.
A single application gives G(x,y)=(x+3,−y), combining reflection across the horizontal axis with translation parallel to it. Applying G a second time changes the first coordinate to x+3+3 and the second to −(−y)=y. Thus G²(x,y)=(x+6,y). If a point were fixed by G, its first coordinate would have to satisfy x+3=x. That equation has no real solution. The second coordinate would also require y=−y, which allows y=0. The first-coordinate condition already excludes every fixed point, including points on the reflecting line.
In a regular heptagon group let r be a positive single-step rotation and s a chosen reflection. With rightmost map first, reduce (sr³)(sr⁵) to a power of r.
Show the answer and reasoning
The product is r² in the heptagon’s symmetry group.
The relation srs=r⁻¹ means conjugation by s reverses the single-step rotation. Since s² is the identity, conjugating a product of three copies of r reverses each copy. Thus sr³s=(srs)³=r⁻³. The factors in the given product may be grouped as (sr³s)r⁵ while preserving their composition order. The product reduces to r⁻³r⁵=r². The powers are interpreted modulo seven because r⁷ is the identity. The result is the positive two-step rotation for the declared rightmost-first order. Each original factor is a reflection, so their composition has the orientation of a rotation.
Compare the lattice generated by (2,0),(0,1) with the one generated by (1,0),(0,1). Find its cell area and describe which old points it contains.
Show the answer and reasoning
The area is two. The new lattice contains exactly the old points with even first coordinate.
The proposed basis has columns (2,0) and (0,1). Its integer combinations are exactly the points (2a,b) with a and b integers. The original unit basis gives every point (x,y) with both coordinates integral. The new set contains precisely those with an even first coordinate, for example (2,1). The original point (1,0) is absent. The determinant of the new basis is two, so its cell has area two square coordinate units. An original unit cell has area one. The coefficient change from the old basis is the diagonal matrix with entries two and one, of determinant two. Its inverse cannot represent (1,0) with integer new coordinates, in agreement with the direct point test.
Compute the interior angle of a regular pentagon and the implied number at a vertex in a congruent edge-to-edge tiling. Decide the case under those rules.
Show the answer and reasoning
The angle is 3π/5, or 108 degrees. The required k=10/3 is impossible under the stated rules.
A regular pentagon’s interior angle is (5−2)π/5=3π/5, or 108 degrees. In the stated tiling, each tile incident to a vertex contributes exactly this angle. To fill around the vertex the total must be 2π, so k·3π/5=2π. Solving gives k=10/3. A number of incident tiles is an integer, whereas 10/3 is not. Three corners leave an angular gap of 36 degrees, and four exceed 360 degrees. The stated congruent regular edge-to-edge tiling is therefore impossible. The obstruction uses corners of the same fixed angle and a complete turn at each vertex.
For focal distance 2 and line (1,0,4)+t(0,2,0), give the image line. State what happens to the vanishing-point calculation for this direction.
Show the answer and reasoning
The image is (1/2,t), with no finite vanishing point for this depth-zero direction.
Every point on the line has coordinates (1,2t,4), so the depth remains four and lies in the visible domain for all real t. Project by multiplying the first two coordinates by f/Z=2/4=1/2. The image is (1/2,t), which is the vertical line with first coordinate one half. The line’s direction has third coordinate zero. Its two transverse direction coordinates multiply by the same constant 1/2, giving the nonzero image direction (0,1). As t tends to either infinity the second image coordinate is unbounded. The finite vanishing-point formula needs a nonzero depth direction, so this case gives an image line with no finite limiting point.
For vertices (0,0),(4,0),(0,6), assign scalar values 0,4,2. Find the barycentric weights of (1,3) and the affine interpolated value.
Show the answer and reasoning
The weights are (1/4,1/4,1/2), and the interpolated value is two.
Let the weights of (0,0),(4,0),(0,6) be a,b,c with a+b+c=1. The weighted coordinate formula for (1,3) requires 4b=1 and 6c=3. Thus b=1/4 and c=1/2. The remaining weight is a=1−1/4−1/2=1/4. They are all nonnegative, so the point lies in the closed triangle. Use the same fractions to interpolate the scalar vertex values. The result is (1/4)·0+(1/4)·4+(1/2)·2=0+1+1=2. Direct substitution into the coordinates gives (4·1/4,6·1/2)=(1,3). This verifies both coordinates and the normalization of the affine weights.
A piece of duration one ends with final controls (2,0),(3,0). A piece of duration two starts at (3,0) and then has control (5,0). Compare the two velocities, then repeat with second control (4,0).
Show the answer and reasoning
Control (5,0) gives matching velocities (3,0). Control (4,0) gives following velocity (3/2,0) with the same tangent direction.
Both pieces meet at (3,0), giving position continuity. For the first cubic, the adjacent control difference at the end is (3,0)−(2,0)=(1,0). Its end velocity over duration one is (3,0). For duration two and next control (5,0), the new starting control difference is (2,0). The start velocity is (3/2)(2,0)=(3,0), equal to the prior end velocity. With next control (4,0), the starting difference is only (1,0). Over the same duration the starting velocity becomes (3/2,0). The meeting position still equals (3,0). The first choice matches velocity. The second keeps both nonzero vectors pointing in the positive horizontal direction while the speeds differ by a factor of two. Position and oriented tangent then match, and velocity continuity fails.
Remove [3,5]×[1,3] from the uniform rectangle [0,6]×[0,4]. Find the centroid of the remainder.
Show the answer and reasoning
The remaining centroid is (14/5,2).
The original rectangle has area 6·4=24 and centroid (3,2), the midpoint of each coordinate range. The cutout has area 2·2=4 and centroid (4,2). The remaining area is 24−4=20. Its first moment in each coordinate comes from subtracting the cutout’s area times its centroid from the original total. The first coordinate is (24·3−4·4)/20=56/20=14/5. The second is (24·2−4·2)/20=40/20=2. The result (14/5,2) lies on the remaining region’s axis of symmetry y=2. Removing material to the right of the old centroid accounts for the change from three to fourteen fifths.
With relative background luminance one fifth, compute both contrast ratios and select the larger one under the stated formula.
Show the answer and reasoning
The ratios are five for black and 21/5 for white, so black gives the larger model ratio.
Use L=1/5=0.20. In the model the black ratio is (0.20+0.05)/(0+0.05). Its value is 0.25/0.05=5. For white, the ratio is (1+0.05)/(0.20+0.05)=1.05/0.25. This equals 21/5, or 4.2. Since 5=25/5 is greater than 21/5, black gives the larger model ratio. Both ratios use the same uniform background and the declared relative-luminance scale. The result agrees with the threshold because one fifth is above (√21−1)/20. The calculation compares the stated mathematical contrast for those two choices.
For ideal length 0.65 metres and transverse wave speed 260 metres per second, find the first three positive fixed-end frequencies.
Show the answer and reasoning
The first three frequencies are 200, 400 and 600 Hz.
For fixed ends, the ideal frequency formula is f_n=nc/(2ℓ) for positive integer n. Substitute ℓ=0.65 metres and c=260 metres per second. Twice the length is 1.30 metres. Dividing 260 metres per second by 1.30 metres gives 200 per second, or 200 hertz, for n=1. The mode n=2 has twice this frequency, 400 hertz. The mode n=3 has three times it, 600 hertz. The positive integer n also counts the number of half-wavelengths on the string. These are ideal fixed-end values in the linear wave model with constant wave speed.
Compute the frequency ratio between twelve exact fifths and seven exact octaves above the same starting frequency. Determine which sequence ends higher.
Show the answer and reasoning
The ratio is 531441/524288. Twelve fifths end higher.
An exact fifth multiplies frequency by 3/2 and an exact octave by two. From the same initial frequency, the ratio of the final values is (3/2)¹²/2⁷. Collect the powers to obtain 3¹²/2¹⁹. The exact integer powers are 3¹²=531441 and 2¹⁹=524288. Their positive difference is 7153, so the ratio 531441/524288 is larger than one. The sequence of twelve exact fifths ends at the higher frequency. The shared starting frequency cancels in the comparison. It determines the absolute frequencies of the two results and leaves this ratio unchanged.
A target is 260 cents above the reference in a twelve-step equal-ratio system. Find its nearest step using absolute cents and the signed error from target to chosen note.
Show the answer and reasoning
Index three is nearest and the signed error from target to chosen note is +40 cents.
The step size is 1200/12=100 cents. The target at 260 cents has real-valued step coordinate 260/100=2.6. The adjacent available steps are two and three, corresponding to 200 and 300 cents. Their absolute errors are 60 and 40 cents respectively. Every other step has cents value at least as far from 260 as the farther of these two neighbors, so index three is the unique nearest step in this criterion. The signed error of the chosen note relative to the target is 300−260=+40 cents. This criterion compares logarithmic frequency intervals.
Compute the eight floor differences for three accents. Give examples of length-three windows achieving each possible count, using cyclic indexing as needed.
Show the answer and reasoning
The pattern is (0,0,1,0,0,1,0,1). Length-three windows starting at zero and five give counts one and two.
For k=3 and n=8, evaluate the floors at indices zero through eight. They are 0,0,0,1,1,1,2,2,3 in that order. Taking successive differences gives (0,0,1,0,0,1,0,1), indexed from zero. Its ones are at indices two, five and seven, so the total is three. A window of length three has average target count 3·3/8=9/8. The floor-difference bound permits the integers one and two. Starting at zero gives indices zero, one, two with count one. Starting at five gives five, six, seven with count two. The window crossing the boundary from seven through zero to one gives count one, confirming the periodic convention.
For f(t)=sin(2πt/T)+(1/2)sin(4πt/T), compute the RMS and decide whether half-period translation negates the whole function.
Show the answer and reasoning
The RMS is √(5/8). Half-period translation leaves the second harmonic’s sign unchanged, so the full waveform does not reverse sign.
The first harmonic has sine coefficient one and the second has sine coefficient one half. Both cosine coefficients and the constant term vanish. The mean square over a period is ½[1²+(1/2)²]=5/8, so the RMS is √(5/8). The cross term has zero mean by different-harmonic orthogonality. Increasing t by T/2 changes the first sine’s argument by π and the second’s by 2π. The first term changes sign, while the second term is unchanged. For instance at t=T/8 the second sine equals one. The translated waveform and the negative of the original therefore differ by one at that time. Half-period sign reversal fails with the stated nonzero even harmonic.
For 0≤x≤5 integer, round the row y=2x/5 to the nearest integer with the stated tie rule. Give all rows, their largest vertical error and the maximum row jump.
Show the answer and reasoning
The rows are 0,0,1,1,2,2. The largest vertical error is 2/5 and the greatest jump is one.
At columns zero through five, the exact heights are 0,2/5,4/5,6/5,8/5,2. Rounding to the nearest integer gives row coordinates 0,0,1,1,2,2. Subtracting each height from its rounded row gives 0,−2/5,1/5,−1/5,2/5,0. The largest absolute vertical error is 2/5 of a row. The successive row jumps are 0,1,0,1,0, so the maximum absolute jump is one. The corresponding points are consecutive in the horizontal-or-diagonal neighbor relation. The slope magnitude is 2/5, within the range where the general row-jump bound holds. None of the exact heights is halfway between integer rows, so the tie rule is unused.
Fit source (0,0),(1,0),(2,0) to target (1,0),(3,0),(6,0), holding orientation fixed. Find the optimal nonnegative scale, translation and squared residual total.
Show the answer and reasoning
The optimal scale is 5/2, the translation is (5/6,0), and the squared residual total is 1/6.
The source and target y coordinates are all zero. The source mean has first coordinate one and the target mean has first coordinate 10/3. Centering their first coordinates gives (−1,0,1) and (−7/3,−1/3,8/3). The sum of squared centered source coordinates is two. The sum of paired products is 7/3+8/3=5. The optimal scale is the positive value 5/2, and the translation is (10/3−5/2,0)=(5/6,0). The resulting fitted first coordinates are 5/6,10/3,35/6. Subtracting them from the target first coordinates gives residuals 1/6,−1/3,1/6. All second-coordinate residuals are zero. The squared residual total is 1/36+1/9+1/36=1/6. Since the scale is positive, the nonnegativity constraint is satisfied at the unrestricted minimizer.
What to carry forward
- An area multiplier can preserve an area while individual lengths and angles change.
- Two different integer bases can describe the same lattice when their coordinate change is reversible over the integers.
- Depth enters a projection by division and changes how parallel spatial lines appear.
- Control differences and parameter duration together determine the velocity where curves meet.
- Logarithmic frequency intervals and absolute hertz errors select nearest notes by different criteria.
- The sampling grid determines when continuous-frequency choices produce identical readings.
- A stated spacing or smoothness assumption turns a visual approximation into an exact error bound.
- Point fitting and covering arguments quantify different aspects of a design.
References
Sources for the concepts and teaching approaches in this article.
- Lattice basis changes and a fundamental cellAmitabh BasuPrimary · PDF
- Angles that meet in a regular tilingBrian KellPrimary
- The limiting location of a projected lineAntonio Torralba, Phillip Isola and William T. FreemanPrimary
- Projective invariance of a four-point cross-ratioRichard Hartley and Andrew ZissermanPrimary · PDF
- Nearest-site regions and affine interpolationStanford CS205A course notesPrimary · PDF
OpenStax2 sources
- Centroid as a normalized first momentOpenStaxPrimary
- University Physics Volume 1, §16.6 Standing Waves and Resonance, Both-end nodes and modal frequencies, selected lines 76–87.OpenStaxPrimaryFixed-end modes of an ideal vibrating stringTwo nearby frequencies and their beat envelope
- Ratios, cents and a fifth-octave discrepancyQuadrivium PressPrimary
- Cyclic onset patterns and evennessErik D. Demaine and coauthorsPrimary · PDF
- A Fourier basis from complex roots of unityBen LynnPrimary
Massachusetts Institute of Technology2 sources
- A second-derivative chord interpolation boundBiswarup BiswasPrimary
- A line cut into two related lengthsEuclid, translated by David E. JoycePrimary
- Nested triangle construction and a covering exponentUniversity of Warwick course manuscript hosted by Mark PollicottPrimary · PDF
- Least-squares intercept and slope through centered dataNIST/SEMATECHPrimary
- Find the greatest common measureEuclid, English presentation by David E. JoycePrimary
- A picture as a section of the visual pyramidLeon Battista AlbertiPrimary
- Norm definitions and finite-dimensional comparisonStephen Boyd and Lieven VandenberghePrimary · PDF
- Round down to the lower integerEric Lehman, F. Thomson Leighton and Albert R. MeyerPrimary · PDF