Fixed MSVC++ compile error due to sqrt() usage.