H
H
hbrmdc2017-10-09 12:00:07
JavaScript
hbrmdc, 2017-10-09 12:00:07

How to calculate the position of a point on the edge of a circle?

I'm trying to put the center of a circle on the edge of another circle using JS: https://prnt.sc/gv2sbz
Can't use CSS as it's for react-native. But there is I can useposition: absolute

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Dubinin, 2017-10-09
@romash

x = X + cos(a) * R, y = Y + sin(a) * R, where
x, y are the coordinates of the center of the small circle;
X, Y - coordinates of the center of the large circle;
a is the angle;
R is the radius of the base circle.
59db434976c9e941294772.jpeg

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question