Maths Question?

thanks every one i managed to get it working once i put it in a function of its own some how that fixed the problem, thanks guys