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 9110395
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T03:15:32+00:00 2026-06-17T03:15:32+00:00

I trying to draw custom arc in current context, but the result is not

  • 0

I trying to draw custom arc in current context, but the result is not what i expected to see, i have the simple lines of code if draw method.

-(void) drawRect:(CGRect)rect
{
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextBeginPath(context);
    CGContextSetGrayFillColor(context, 1.0, 0.7);
    CGContextMoveToPoint(context, 100,100);
    CGContextAddArc(context, 100, 100, 80, 0, M_PI_2, 0);
    CGContextClosePath(context);
    CGContextFillPath(context);
}

and here is the result.
enter image description here

But I’m was expected to see result like this. Why M_PI_2 appears on bottom side of the circle? there should be a 3*M_PI_2, what I’m doing wrong? enter image description here

  • 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-06-17T03:15:33+00:00Added an answer on June 17, 2026 at 3:15 am

    This is explained under “Coordinate Systems and Drawing in iOS” in the Drawing and Printing Guide for iOS:

    Each of the drawing frameworks of iOS establishes a default coordinate system based on the current graphics context. In iOS, there are two main types of coordinate systems:

    • An upper-left-origin coordinate system (ULO), in which the origin of drawing operations is at the upper-left corner of the drawing area, with positive values extending downward and to the right. The default coordinate system used by the UIKit and Core Animation frameworks is ULO-based.

    • A lower-left-origin coordinate system (LLO), in which the origin of drawing operations is at the lower-left corner of the drawing area, with positive values extending upward and to the right. The default coordinate system used by Core Graphics framework is LLO-based.

    A positive angle (like M_PI_2) represents a rotation from the positive X axis toward the positive Y axis. So in the graphics contexts given to you by UIKit, a positive angle rotates down.

    See also this answer.

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

Sidebar

Related Questions

I'm trying to draw custom ColumnHeaders in a FastObjectListView control. So far the code
Basically the code is trying to take a source image, draw some custom text
I am trying to draw an isometric square with some custom code to build
I have a custom delegate derived from QStyleOptionViewItem which is trying to draw multiline
I'm trying to draw custom UI (a path in this case) on top of
I am trying to draw a waveform. I have a precalculated amount of datapoints
I am trying to draw a picture to the window but it is only
I am trying to draw custom shapes in iPad application. I am using UIBezierPath
I'm trying to draw a custom view with a drop shadow. I'm having different
I have implemented custom draw for an CTreeCtrl in my MFC Smart Device program.

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.