Coding-Challenges icon indicating copy to clipboard operation
Coding-Challenges copied to clipboard

145_Ray_Casting - optimice performance by using square distance

Open strech345 opened this issue 1 year ago • 0 comments

when using dist only for compare, its better to use the square distance. Because otherwise quare-root needs to be calculated which is much more cpu heavy.

https://github.com/CodingTrain/Coding-Challenges/blob/2a9d68112b1aa80cbd5aa303f1d97dda7b045fde/145_Ray_Casting/P5/particle.js#L29

strech345 avatar Feb 29 '24 12:02 strech345