Did a modification... In @TheLogFather, the rate was calculated by some if statements. Whtat I've done here is to calculate something close to the longest length from point to incenter, by squaring each length, adding together, all divided by the sum of the lengths. In other words, it is (x^2 + y^2 + z^2 ) / x + y + z
Credit to @TheLogFather for original scripts.