Hi Forum:
I am having a problem with a function. this is expression to calculate TDVI (transformed difference vegetaion index) and the value should be between -1 and 1 but I am getting all values >0 and beyond 1. the below is my band math equation.
FUNCTION td1,b1,b2
tdvi = 1.5* ((float(b1)-float(b2))/(float(b1*b1)+b2+0.5)^0.5)
RETURN,tdvi
END
To understand better the situation here is the equation in excel, this works well though.
=1.5*(B3-A3)/SQRT(B3*B3+A3+0.5)
Please suggest, how to fix the equation?
Thanks in advance
|