iOS angle and radians conversion

Source: Internet
Author: User

In iOS, a picture is rotated in radians rather than angles , so it is often converted between the two

  1. Radian to Angle
#define RADIANS_TO_DEGREES(radians) ((radians) * (180.0 / M_PI))
  1. Angle to radians
#define DEGREES_TO_RADIANS(angle) ((angle) / 180.0 * M_PI)

Excerpt from: Conversion of angles to radians
<!--more--

Angle Radian Definition

Radians and degrees are two different units of measure angular size.

Degree

Two rays are shot from the center to the circumference, forming an arc of a positive pair of angles and angles. When the length of the arc is exactly equal to one of 360 of the circumference, the angle of the two rays is 1 degrees.

Radian

Two rays are shot from the center to the circumference, forming an arc of a positive pair of angles and angles. When the arc length is exactly equal to the radius of the circle, the angle size of the two rays is 1 radians.

?

formula:π is π radian, 180 is 180 degrees. I'm going to turn it into a unit, and I'm going to put the unit on the molecule. That is, I'm going to turn it into radians and I'm going to put π radians on the molecule-multiplied by π/180

Turn from: The relationship between radians and angles

iOS angle and radians conversion

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.