Uibezierpath the record of drawing arcs

Source: Internet
Author: User

Uibezierpath through

-(void) Addarcwithcenter: (cgpoint) Center radius: (cgfloat) Radius startangle: (cgfloat) startangle endangle: (cgfloat) Endangle clockwise: (BOOL) clockwise

You can draw an arc.

Look at the meaning of each parameter:

Center: coordinates of Center point

Radius: Radius

StartAngle: The starting Radian

Endangle: Arc-End Radian

Clockwise:yes is clockwise, no is counterclockwise

The main method is to understand startangle and Endangle, just at the beginning I do not know where a circular arc from the beginning and end, such as the radian is 0, is from up and down which point to start counting

Look at the picture below and it's clear.

See 0Pi is the right side of the circle to start calculating, clockwise to m_pi/2,m_pi,m_pi*1.5

You know, it's easy to draw an arc with Bezierpath.

For example, to draw the bold paragraph is:

[HTML]View PlainCopy 
    1. Uibezierpath *Path = [[Uibezierpath alloc] init];
    2. [Path Addarcwithcenter:center
    3. Radius:radius
    4. startangle:m_pi*1.1
    5. endangle:m_pi*1.9
    6. Clockwise:yes];

Uibezierpath the record of drawing arcs

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.