Application of Pythagorean theorem and triangle ratio rules