Added functionality for calculating the scale of triangle