Answer the question
In order to leave comments, you need to log in
Why sine?
Good day. There is such a problem:
There is a point on the plane. We know where this point "looks", that is, we know its degree of rotation. If we have degrees of rotation, then we have a mental circle. So, it is required to determine the coordinates of the second point, which is always located where our first point "looks". That is, if the first point looks at 30 degrees, then you need to find out the coordinates of the point that is located at these 30 degrees. Here's the picture:
The green circle is the starting point. We know its X,Y coordinates and the angle of rotation, that is, where it is looking (shown by the arrow).
We need to find the coordinates of the blue circle (it is always where the green circle is looking, and is 10 coordinates away from it).
Now why did I mention the sine in the question. The fact is that I met the solution of this problem, but did not quite understand why the X-axis added the sin of the angle multiplied by 10, and the Y-axis cos, also multiplied by 10.
Answer the question
In order to leave comments, you need to log in
This follows directly from the definition of sine and cosine. sin(x) - ordinate of a point of a unit circle with an arc of angle x, cos(x) - abscissa.
In this problem, the sine is not needed.
double r=sqrt(x*x+y*y);
double cf=1+10/r;
double x1=x*cf,y1=y*cf;
(x1,y1) - coordinates of the required point.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question