Triangle similarity and length calculations