Second-order expansion of a triangle angle (RC6b, step 4b) #
The squared lengths of a triangle are a₀ (1 + x), b₀ (1 + y), c₀ (1 + z) with small relative
errors. The cosine of the angle between the first two edges is then a smooth function of
(x, y, z); this file expands it, and the angle, to second order with an explicit cubic remainder.
Main results #
abs_invSqrt_sub_le:|1/√(1+x) - (1 - x/2 + 3x²/8)| ≤ 2|x|³for|x| ≤ 1/2.
First-order term of the cosine: with P = (a₀ x + b₀ y - c₀ z) / (2 √(a₀ b₀)) and
u = cosArg a₀ b₀ c₀, it is P - u (x + y) / 2.
Equations
Instances For
The cosine of a perturbed triangle to second order. The squared lengths a₀ (1 + x),
b₀ (1 + y), c₀ (1 + z) have relative errors at most ε ≤ 1/2, and a₀ + b₀ + c₀ ≤ 2 R √(a₀ b₀)
(bounded side ratio). Then the cosine differs from u + cosLin + cosQuad by at most (7 + 5 R) ε³,
where u is the unperturbed cosine.
Pure algebra behind the angle expansion: if Δ = ℓ + q₂ + E with ℓ = O(ε), q₂ = O(ε²),
E = O(ε³), and T is the Taylor defect, then T - E/q + u (ℓ² - Δ²)/(2 q³) is O(ε³).
A triangle angle to second order. Under the hypotheses of abs_cosArg_expansion_le, and
with the cosines before and after in [-s, s], s < 1, the angle triAngle of the perturbed
triangle differs from the unperturbed one by
-(ℓ + q₂)/q - u ℓ²/(2 q³) up to angK R m ε³, where u is the unperturbed cosine, ℓ, q₂ are
cosLin, cosQuad, q = √(1 - u²) and m = √(1 - s²).