Rotation formula of a plane point and a plane rotation formula

Source: Internet
Author: User

Rotation formula of a plane point and a plane rotation formula

Definition: the rotation of a point O above a plane is to make any pair of corresponding points P and P on the plane equal to the line segments connected to a fixed point O, that is, | OP | = | OP '|, And the directed angle <POP' is equal to the determined directed angle β. The point O is called the center of rotation, and the directed angle β is called the rotation angle.

Take the Cartesian coordinate system for the transformation formulaOrigin OCenter of rotation,Rotation Angle is BetaAny point of P (x, y) on the plane is rotated to P' (x', y ')


The Rotation Transformation Formula is

 

1 // Point Rotation 2 PointF rotatePoint (PointF p, double RotAng) 3 {4 // Why/180, because the radians and degrees are converted to 5 double RotAngF = (RotAng * Math. PI/180d); 6 double SinVal = (Math. sin (RotAngF); 7 double CosVal = (Math. cos (RotAngF); 8 double Nx = (p. X * CosVal-p. Y * SinVal); 9 double Ny = (p. Y * CosVal + p. X * SinVal); 10 return new PointF (Nx, Ny); 11} Point Rotation


Author: orange1438
Source: http://www.cnblogs.com/orange1438/
The copyright of this article belongs to the author and the blog garden. Reprinting is welcome, but this paragraph statement must be retained without the author's consent, and a link to the original text should be given in the obvious position of the article page, otherwise the right to pursue legal responsibility is reserved.
 


Related Article

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.