U
U
Urukhayy2015-01-28 09:31:29
Programming
Urukhayy, 2015-01-28 09:31:29

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:
Z9KF5Hm.png
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

3 answer(s)
V
Vit, 2015-01-28
@fornit1917

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.
1024px-Trigonometric_function.png

M
Mrrl, 2015-01-28
@Mrl

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.

T
ThemeZV, 2015-01-28
@ThemeZ

Let me remind you that sin is the ratio of the opposite leg to the hypotenuse, cos is the ratio of the adjacent leg to the hypotenuse.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question