N
N
Newbie Ivanovich2019-09-02 06:05:59
Geometry
Newbie Ivanovich, 2019-09-02 06:05:59

How to determine if an object hit a certain point on the map with a radius of X?

there are point coordinates
"latitude": "71.848140",
"longitude": "137.618294",
"radius": "0.0005",
when tracking coordinates I get
"latitude": "XX.848140",
"longitude": "XXX.618294" ,
How to compare coordinates and find out whether the tracked object hit the point or not?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
N
nrgian, 2019-09-02
@NovichokIvanovich

School geometry.
(X-A)*(X-A) + (YB)*(YB) < R

A
Alexander, 2019-09-02
@NeiroNx

Pythagorean theorem (right triangle). If the distance is less than the specified - then hit. In order not to suffer with the square root, you can compare the numbers already squared.

M
Moskus, 2019-09-02
@Moskus

The Pythagorean theorem after reducing the points to a rectangular coordinate system. And then in degrees you count it there ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question