Need help on CGAffineTransformMakeRotation rotation value

Discussion in 'iOS Programming' started by newbie80, May 10, 2011.

  1. macrumors member

    Mar 2, 2011

    I have the following codes for CGAffineTransformMakeRotation
    float tempF = atan2(location.y -, location.x -;
            [UIView beginAnimations:@"animation" context:nil];
            CGAffineTransform viewTransform = CGAffineTransformMakeRotation(tempF);
            plans_shapea.transform = viewTransform;
            [UIView commitAnimations];
            [statusRotate setText:[NSString stringWithFormat:@"%d",tempF]];
            if(tempF == 0 || tempF == 1610612736){
            if(tempF != 0){
    I trace the value for "tempF", but when I rotate to 12 o'clock, 3 o'clock, 6 o'clock and 9 o'clock, they gave me the same value which is 0. I would like to know how do I get all different values? or maybe is there other way for me to change it to degrees from 0 to 360 degrees?
    Any help will be appreciated.

Share This Page