Pythagorean Theorem: Proof and Applications