Home > Software engineering >  How to obtain the coordinates of each point on the circle
How to obtain the coordinates of each point on the circle

Time:11-22

Have a great god grant instruction, I am a program beginner, hope that through the MFC (also can be other software) write an interface, by manual input and the center of the circle radius, and then automatically generate an x, y, z coordinates of the file, format for "TXT".
Interface is similar to -

Data generated document --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
X y z
1 2 3
2 4 6
3 6 9
. . .

CodePudding user response:

Sin (x) + r, cos (x) + r

CodePudding user response:

Just do it, the difficulty coefficient 0

Use MFC wizard to do a frame
Add A menu item to start the data generation, click the pop-up dialog after A
Add A dialog box. A, to enter the origin radius
Dialog input "sure", A, Z ^ 2=(X - X0) ^ 2 + (Y - Y0) ^ 2=R ^ 2 X: [X0 - R, X0 + R], and Y, (note that each X, Y)
After calculation, the calculated results in a TXT file

CodePudding user response:

 
For (int x=x0 - r; x{
Y1=SRQT (... );
Y2=SRQT (... );
Savetofile ();
}

CodePudding user response:

Round (0, 0)
Angle: the Angle
X=r * cos (Angle)
Y=r * sin (Angle)
Principle: the equation of circle: x * y=x + y * r * r, just is a trigonometric function,

CodePudding user response:

In addition to the starting point should also have a step, if one point 1 degree is 360 points, if one point 2 degrees is 180 points,

CodePudding user response:

Radius of center set ox, oy=r=
Starting from the top: what are the coordinates of the points in the circular curx=ox, cury=oy - r;
Starting from this point calculation (curx + 1, cury) (curx, cury + 1) (cury curx + 1, + 1) this 3 points from (ox oy) of square and the r square is poor, take 3 points difference minimum point as the current point, continue to
Until draw round the xy flip again after get 45 degrees 90 degrees circle, get 180 degree circle x y mirror mirror again get 360 - degree image
  • Related