(** * Distance *)

Definition dist_euc (x0 y0 x1 y1:R) : R :=
  sqrt (Rsqr (x0 - x1) + Rsqr (y0 - y1)).

Lemma law_cosines : forall x0 y0 x1 y1 x2 y2 ac:R, let a := dist_euc x1 y1 x0 y0 in let b := dist_euc x2 y2 x0 y0 in let c := dist_euc x2 y2 x1 y1 in a * c * cos ac = (x0 - x1) * (x2 - x1) + (y0 - y1) * (y2 - y1) -> Rsqr b = Rsqr c + Rsqr a - 2 * (a * c * cos ac).