Example of a floating point error bug from today that fixed point wouldn’t have helped: I’m calculating the bisector of two vectors a and b. |a|b + b|a| is numerically unstable if vectors are nearly opposite (and fails entirely if vectors are exactly opposite).
-
-
The problem is, more generally, subtracting two nearly-equal numbers, correct? Or am I misunderstanding?
-
Right (and also subtracting two exactly-equal numbers).
- 3 more replies
New conversation -
-
-
Quick attempt to visualize this idea (with equal length vectors): https://www.desmos.com/geometry/8qjwtw8qqw …pic.twitter.com/Oat8ZSWZDP
-
Yup. Credit to FreeType for the technique :)
End of conversation
New conversation -
-
-
I'm curious - how do you decide which one of two possible resulting vectors to use? The procedure above gives stability only to tangent of bisector, but does not give stability to direction of the vector. How could swapping of vectors a and b affect the result?
-
Yeah, so this is part of a dilation algorithm that expands outlines to make them thicker, so there’s a prepass that determines the appropriate winding order (CW or CCW) and that winding order determines which one we negate.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.