Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: a couple of CGContext questions



On Jan 31, 2007, at 3:35 PM, Laurence Harris wrote:

On Jan 31, 2007, at 4:53 PM, Steve Christensen wrote:

On Jan 31, 2007, at 9:11 AM, David Duncan wrote:

On Jan 31, 2007, at 07:58 AM, Mike Kluev wrote:

Wait, what's wrong with CGAffineTransformInvert?

Hadn't thought of that, but same mathematical problems without all the code maintenance ones.


Doing this is akin to trying to draw bicycle spokes by appending a rotation to the context. By the time your done, the floating point errors have accumulated to the point that your spokes don't look correct.

Tho, isn't an inverse just a straight mathematical operation on the actual values in the transform matrix? If so, there's shouldn't be an accumulation error, but I suppose there could be rounding ones where you end up with a 1.000000000000001 or 0.9999999999985 someplace.

Define "straight mathematical operation." If you mean each entry in the inverse matrix is found by operating on one element of the original, then no, it isn't. Google for "inverting a matrix."

No, that the operation is performed on all of the elements, such that for a given source matrix you end up with a unique inverse matrix. With the rotation example Mike mentioned above, the final result is based on iterative additions that can accumulate potentially large errors.


I also read Aaron's reply about ill conditioned matrices that can generate errors in the inversion process. I guess it just goes back to my original thought about having a way to specifically set the CTM, thus eliminating this whole issue... :-)

steve


_______________________________________________ Do not post admin requests to the list. They will be ignored. Carbon-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: a couple of CGContext questions (From: Mike Kluev <email@hidden>)
 >Re: a couple of CGContext questions (From: David Duncan <email@hidden>)
 >Re: a couple of CGContext questions (From: Steve Christensen <email@hidden>)
 >Re: a couple of CGContext questions (From: Laurence Harris <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.