Try / Tempest

3d graphics engine
MIT License
83 stars 24 forks source link

Misleading method name "manhattenLength" #24

Closed aaeberharter closed 2 years ago

aaeberharter commented 2 years ago

In the engine we see the following code for 1D to 4D points:

https://github.com/Try/Tempest/blob/1f832345feea7799f09a266f3128484a0e0a5c33/Engine/utility/utility.h#L120

However manhatten length is defined by

std::abs(x) + std::abs(y) + std::abs(z)

The length currently implemented is the euclidean length, as it should be. I recommend to simply rename it to

T Length() const { return T(std::sqrt(x*x+y*y+z*z)); }

Try commented 2 years ago

Hi, @aaeberharter !

Thanks for reporting, indeed method name was not correct