Affine bases and barycentric coordinates #
Suppose P is an affine space modelled on the module V over the ring k, and p : ι → P is an
affine-independent family of points spanning P. Given this data, each point q : P may be written
uniquely as an affine combination: q = w₀ p₀ + w₁ p₁ + ⋯ for some (finitely-supported) weights
wᵢ. For each i : ι, we thus have an affine map P →ᵃ[k] k, namely q ↦ wᵢ. This family of
maps is known as the family of barycentric coordinates. It is defined in this file.
The construction #
Fixing i : ι, and allowing j : ι to range over the values j ≠ i, we obtain a basis bᵢ of V
defined by bᵢ j = p j -ᵥ p i. Let fᵢ j : V →ₗ[k] k be the corresponding dual basis and let
fᵢ = ∑ j, fᵢ j : V →ₗ[k] k be the corresponding "sum of all coordinates" form. Then the ith
barycentric coordinate of q : P is 1 - fᵢ (q -ᵥ p i).
Main definitions #
affine_basis: a structure representing an affine basis of an affine space.affine_basis.coord: the mapP →ᵃ[k] kcorresponding toi : ι.affine_basis.coord_apply_eq: the behaviour ofaffine_basis.coord ionp i.affine_basis.coord_apply_neq: the behaviour ofaffine_basis.coord ionp jwhenj ≠ i.affine_basis.coord_apply: the behaviour ofaffine_basis.coord ionp jfor generalj.affine_basis.coord_apply_combination: the characterisation ofaffine_basis.coord iin terms of affine combinations, i.e.,affine_basis.coord i (w₀ p₀ + w₁ p₁ + ⋯) = wᵢ.
TODO #
- Construct the affine equivalence between
Pand{ f : ι →₀ k | f.sum = 1 }.
- points : ι → P
- ind : affine_independent k self.points
- tot : affine_span k (set.range self.points) = ⊤
An affine basis is a family of affine-independent points whose span is the top subspace.
Instances for affine_basis
- affine_basis.has_sizeof_inst
- affine_basis.inhabited
Given an affine basis for an affine space P, if we single out one member of the family, we
obtain a linear basis for the model space V.
The linear basis correpsonding to the singled-out member i : ι is indexed by {j : ι // j ≠ i}
and its jth element is points j -ᵥ points i. (See basis_of_apply.)
The ith barycentric coordinate of a point.
A variant of affine_basis.affine_combination_coord_eq_self for the special case when the
affine space is a module so we can talk about linear combinations.
Barycentric coordinates as an affine map.
Given an affine basis p, and a family of points q : ι' → P, this is the matrix whose
rows are the barycentric coordinates of q with respect to p.
It is an affine equivalent of basis.to_matrix.
Given a family of points p : ι' → P and an affine basis b, if the matrix whose rows are the
coordinates of p with respect b has a right inverse, then p is affine independent.
Given a family of points p : ι' → P and an affine basis b, if the matrix whose rows are the
coordinates of p with respect b has a left inverse, then p spans the entire space.
A change of basis formula for barycentric coordinates.
See also affine_basis.to_matrix_inv_mul_affine_basis_to_matrix.
A change of basis formula for barycentric coordinates.
See also affine_basis.to_matrix_vec_mul_coords.
If we fix a background affine basis b, then for any other basis b₂, we can characterise
the barycentric coordinates provided by b₂ in terms of determinants relative to b.