D
D
di_gangsta2016-08-26 12:37:42
Java
di_gangsta, 2016-08-26 12:37:42

How to find the end point of a line segment?

For example, there is a hedgehog, which is located in the coordinate (300,500)
Here the hedgehog starts moving in the direction with a random angle. In this case, he began to move at an angle of 163 degrees relative to the upper y-axis. (Y)
We know that the hedgehog has traveled a distance of 120. Where did he come to? We need the coordinates. How to calculate what formula, help somehow, thanks in advance!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
U
Urvin, 2016-08-26
@di_gangsta

len = 120;
f = degreesToRadian(163);
x0 = 300;
y0 = 500;
x = x0 + cos(f) * len;
y=y0 + sin(f) * len;

A
Alexey Cheremisin, 2016-08-26
@leahch

h=120*sin(163) is the height
w = sqrt(h** + 120**) - length
(300+w, 500+h) - new coordinates!
Geometry 6th grade, right triangle (the link was not inserted just like that) -

https://www.fxyz.ru/формулы_по_геометрии/плоские_фигуры/треугольник/решение_прямоугольного_треугольника/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question