views:

53

answers:

1

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

A: 

You need an affine transformation, and a simple one, just scaling. See Wikipedia under the section Examples in 2D graphics and you want the scaling piece.

Peter K.