Applying ratio theorem to triangles