using fixed-point floating point to represent position
Posted: Sun Jun 24, 2012 9:07 pm
I think it makes more sense to use fixed-point to represent position. please correct me if I'm wrong.
reason: precision of floating-point depends on the location, and it is highly clustered around 0.
consequence: you can't expect position-invariant precision.
1. people should avoid positions too far from the origin.
2. precision at (0,0,1000000) depends on the axis direction
using fixed-point
pro: guarantees position-invariant precision.
con: max value is fixed, and you should use proper scale.
But I would say the fixed-point's con is not actually that bad, since too high value is discouraged even with the floating point. It only makes the bad practice explicitly impossible.
The attached imgs are
1. fixed point resolution with 7-bit integer.
2. floating point resolution with sign bit, 3-bit exponent and 3-bit mantissa
both are scaled to have the same max.
reason: precision of floating-point depends on the location, and it is highly clustered around 0.
consequence: you can't expect position-invariant precision.
1. people should avoid positions too far from the origin.
2. precision at (0,0,1000000) depends on the axis direction
using fixed-point
pro: guarantees position-invariant precision.
con: max value is fixed, and you should use proper scale.
But I would say the fixed-point's con is not actually that bad, since too high value is discouraged even with the floating point. It only makes the bad practice explicitly impossible.
The attached imgs are
1. fixed point resolution with 7-bit integer.
2. floating point resolution with sign bit, 3-bit exponent and 3-bit mantissa
both are scaled to have the same max.