Archived

This topic is now archived and is closed to further replies.

Dealing with floats in a litlle math library

This topic is 4946 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m in the process of making a few math helper classes, but I have a problem dealing with floats. Those appear mainly when testing equality, or a vector''s appartenance to a plane, etc. I figured I could use smoe kind of tolerance mechanism, allowing a specific delta interval where the components could be considered equal, but I''m not too sure... BTW, I''m mainly concerned with geometry for now, but open to suggestions. Which other classes could be useful ? As of now I haev Points, Lines, Planes, and Vectors. I might include Quaternions but I''m not acquainted much to them yet. I skipped triangles seeing that with triangle fans and strips, it becomes pretty useless.

Share this post


Link to post
Share on other sites
quote:
Original post by xMcBaiNx
Those appear mainly when testing equality, or a vector''s appartenance to a plane, etc. I figured I could use smoe kind of tolerance mechanism, allowing a specific delta interval where the components could be considered equal, but I''m not too sure...

Yea I think that''s the way most does it. Just check if |a-b| is less than some EPSILON. I think there are ways to deduce what epsilon should be, but I don''t know how to do it.

Share this post


Link to post
Share on other sites