Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7599687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:43:28+00:00 2026-05-30T22:43:28+00:00

In an iPad application, I want to move a layer anti-clockwise along an arc

  • 0

In an iPad application, I want to move a layer anti-clockwise along an arc which has a center point of (768, 512) and radius of 512. I want it to start at 12 o’clock (which is top right corner of the screen) and finish at 6 o’clock (bottom right corner).

After a lot of try-and-fail, I got the code working

CGPoint origin = logo.layer.position;

CAKeyframeAnimation *pathAnimation = [CAKeyframeAnimation animationWithKeyPath:@"position"];
pathAnimation.calculationMode = kCAAnimationPaced;
pathAnimation.fillMode = kCAFillModeForwards;
pathAnimation.removedOnCompletion = YES;

CGMutablePathRef curvedPath = CGPathCreateMutable();
CGPathMoveToPoint(curvedPath, NULL, origin.x, origin.y);
CGPathAddArc(curvedPath, NULL, 768, 512, 512, -M_PI_2, M_PI_2, YES);
pathAnimation.path = curvedPath;
CGPathRelease(curvedPath);
pathAnimation.duration = 2;
[logo.layer addAnimation:pathAnimation forKey:@"curve"];

But the problem is I can’t understand the starting angle and end angle parameter. Why should I use -M_PI_2 and M_PI_2 respectively and set the clockwise to YES?

I think I am moving the object from 90 degree to 270 degree anti-clockwise, thus the code should be
CGPathAddArc(curvedPath, NULL, 768, 512, 512, -M_PI_2, M_PI_2, YES);

I am probably wrong in multiple places and by chance got the correct result.

Please correct me and help me understand the two angle parameters:

startAngle

The angle (in radians) from the horizontal that determines the starting point of the arc.

endAngle

The angle (in radians) from the horizontal that determines the ending point of the arc.

Thanks

Leo

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T22:43:29+00:00Added an answer on May 30, 2026 at 10:43 pm

    The location of 0 is on the X axis, like this:

        3*PI/2
          |
    PI ---|--- 0
          |
         PI/2
    

    -PI/2 is equivalent to 3PI/2.

    You’re effectively starting your rotation at the same place (-PI/2, 3*PI/2, 5*PI/2, etc., are all equal)

    “12 o’clock” as you’re thinking of it is 3*PI/2 or -PI/2… and you’re rotating down to “6 o’clock” which is PI/2

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have implemented ipad application in which i want parse table of content but
I made iPad application in which, I want to insert record into database table,
I have an iPad application which has a sign up form within it. The
I made an iPad application in which I want to support orientation, so I've
iPad application I have a large text file which I want to divide into
I am creating an ipad application in which i want to send data to
I have been developing an iPad application in which I want to implement multithreading,
I am trying to build a HTML5 iPad application where I want to provide
In my iPad Application I have multiple views on a screen. What I want
I am developing an iPad application by which i am using image context to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.