3

In iOS, the coordinate (0, 0) means the top left corner. In macOS it is the bottom left corner.

What is the Apple's rationale or technical advantage of this coordinate system?

  • 1
    Surely you would need to ask Apple? FWIW, the two are based on different platforms, using different libraries and conventions. – Oded Feb 3 '14 at 12:52
  • Why are there RISC and CISC architectures? Why is there big endian and little endian? The answer to all these questions and more can be found here. – Neil Feb 3 '14 at 13:22
  • If you do enough graphics program you will deal with this. It isn't even an Apple thing. In OpenGL the (0,0) is the bottom left. In DirectX its top left. Someone somewhere made a decision. (Might be wrong on those as its from memory) – Rig Feb 3 '14 at 15:12
4

There are very specific legacy and mathematical reasons why this is the case. Let's go back in time for a bit. It's the 1980s. The Apple Lisa pioneered a visual system known as LisaGraph. This evolved into QuickDraw which was extended as it became obvious that more colors and resolution were needed. QuickDraw was a 2D raster system that had a fixed number of pixels and used a reflected Cartesian system of coordinate numbering with negative numberings being at the left and top and positive being right and bottom. (0,0) would have been the center of the screen.

This system got tossed out the Window when Steve Jobs came back to Apple and brought NeXTStep with him. NeXT had used Display PostScript to power NeWS, its windowing system. Display Postscript uses a vector coordinate system with the lower left corner being (0,0) as this is how vectors are commonly referenced in mathematics.

Thus when it came time to build Quartz for Mac OS, they kept the same coordinate system and vector baseline. You can flip Quartz and Cocoa windows on Mac OS X if you want them to be similar to iOS.

The dominate coordinate system is upper left from Windows and it makes sense that Apple wanted to attract as many people as possible to build apps for its hotly selling tablets and phones. Given that the views can rotate with the phone in iOS but not Mac OS X, it stands to reason that they'd want the coordinate model for iOS to be fixed rather than adjustable.

0

The answer is: because they can. Whenever there are 2 or more ways to do something there will be 2 or more ways that it is done.

Seriously though, Y up the page is the maths convention and Y down the page is the natural direction for filling an empty page. Both are arguable.

Other examples include: coords as (X,Y) or (Y,X); rotation origin to right (maths) or up (as in a clock); matrices in row major or column major order. The list is endless.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.