Post #2797267
2026-04-14 18:19 UTC
@lisyarus@mastodon.gamedev.place
2. I like the recommendation to use hypot for the vector length, but it might be worth mentioning that for maximum accuracy it's preferrable to sort the components, or at the very least identify which one is largest. Computationally, this spares one (expensive) division and one multiplication at the expense of two swaps, but adding the lower terms squared to 1 is more consistently accurate than the three squared terms added in arbitrary order.
Replies (1)
-
@oblomov@sociale.network 2026-04-14 18:20
@lisyarus@mastodon.gamedev.place 2bis. also I don't think anyone ever brought that up as an example in which to use an arbitrary epsilon, but that's a different matter 8-D