Best practice for double coordinates for Point

Viewed 5333

There is System.Drawing.Point which accepts int values for X and Y coordinate paramenters.
This is not what I need.

Then there is System.Windows.Point which accepts double values for X and Y. This is what I'd need, however I am not sure if this is the structure I should be using in a class library project.

Lastly, I found System.Drawing.PointF, but it accepts float values for X and Y coordinate parameters. I'd prefer to use double.

What is the best practice?

Further clarification:

Basically, I have a WPF project and a Class Library project, which serves as a model to the UI. I need to remember Rectangle coodinates (double, double) in the model.

3 Answers

Use Vector2 (System.Numerics) where you can cast the double values to float (where casting to int obviously makes you lose the decimals).

Related