Is there a big difference between using the DirectX vector magnitude math function as opposed to the following code?
float hyp = sqrt(pow(globalVector.x, 2) + pow(globalVector.y, 2))
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Not enough for you to care.
There are improvements that I’d recommend to the function you posted.
No need to call the power function;
x*xandy*ywill be just as good and cheaper.I’d protect against roundoff by scaling, like this pseudo code: