# Distance and inverse sqrt

This topic is 4977 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I am looking for the fastest method to calculate my distance. I have a program that tests different sqrt functions out there. I am finding many fast inverse sqrt functions, is there any way to utilize these for distance other than dividing 1.0f by the result?

##### Share on other sites
Quote:
 Original post by skowI am looking for the fastest method to calculate my distance. I have a program that tests different sqrt functions out there. I am finding many fast inverse sqrt functions, is there any way to utilize these for distance other than dividing 1.0f by the result?

sqrt(x) = x*sqrtInverse(x)

##### Share on other sites
y = x * rsqrt (x)

rqrtf(x) is the very fast newton-rapson aproximation that is floating around everywhere.

##### Share on other sites
Ahh, thanks guys!

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 10
• 11
• 13
• 9
• 11
• ### Forum Statistics

• Total Topics
634090
• Total Posts
3015430
×