As you likely know, in c#, the origin (0,0) of a plane is the upperleft corner. Going to the right and/or under is regarded as +, while going to the left and/or up is -. Opposed to this is the regular math coordsystem:
(0,0)=mid of plane, going up/right = +, down/left = -.
It's kinda counter-intuitive and can be annoying sometimes, since we're used (for years) to using the regular math coords, and you have to recalculate coords as well.
Is this a fundamental design flaw? And do you get used to it after a while? And which other languages use a different coord system like c#?
It is not C# but the display that uses a inverse coordinate system, this comes from the days back when the display was drawn in using a CRT and the image was drawn in top to bottom, left to right. That is why the coordinate system OS's use match that.
Languages like C# are just wrapping the underlying OS's API and that is why C# uses it too.
The mathematical graph plane is a virtual thing, which expands in all directions without limits.
The screen is a real thing, which can not really expand at all.
Instead we use the concept of scrolling and we are used to doing it from a starting point down.
So conceptually the graphics systems all use the same system as a (left-to-right & top-to-bottom) textblock or page in a book . It is about how we scroll to expand/advance the display area.
But it could be defined in any other way; after all e.g. negative coordinates do make sense as opposed to a negative line number..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With