If you simply want to check is the distance is less than a certain number, you can simply omit the sguare root altogether and just square the constant.
Math.hypot() might be useful too.
Math.hypot()