Converting between square and rectangular pixel co-ordinates
Posted
by FlyboyUtah
on Stack Overflow
See other posts from Stack Overflow
or by FlyboyUtah
Published on 2010-03-28T22:15:14Z
Indexed on
2010/03/28
22:23 UTC
Read the original article
Hit count: 141
I'm new at using transforms and this type of math, and would appreciate some direction solving my coding problem. I'm writing in XCode for the iphone, and am working with CGraphics.
Problem: In Xcode, I want to draw curves, lines and so on it's screen of of square pixels. Then convert those points, as close as possible, into non-square pixel sysem.
For example if the original coordinate system is 500 x 500 pixels that are displayed on square screen of 10 by 10 inchs I draw a round circle with the circle formula. It looks round, and all is well.
Now, I draw the same circle on a second 10 x 10 inch screen that is 850 pixels by 500 pixels. Without changing the coordinates, the same circle formual displays something that looks like an egg.
How can I draw the circle on the second screen in a different coordinate system? And in addition, I need to access the set of points x,y system individually.
s
© Stack Overflow or respective owner