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.