Skip to content

Float vs double #1

@lizardking

Description

@lizardking

Hi

I've started to fix a few things in the lib. Currently I'm mainly interested in the Bezier functions and trying to get the Intersects(Line) method to work. Apart from a small bug that I found and fixed in the Utils.Roots method, I have also realized that there seems to be a problem with numeric precision.

Utils defines epsilon which is used in the between method to allow for approcimate values. While the defined epsilon value 0.000001 is working well in the org javascript code of the lib (https://github.com/Pomax/bezierjs) it is not working in C#. C# floats (32bit single precision) are not the same thing as floating point values (64bit double precision) in javascript.

I'm not sure what to do about this. The cleanest solution would be to convert everything to double. However, I'm not sure what impact this will have on the other classes in the lib. What do you think?

Best regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions