Find next point on a circle based on specific distance

BIGNUMSSCAREME

New member
Joined
Aug 25, 2020
Messages
5
I don't have a set of problems for this, as its a coding-related issue. I was just wondering if I graphed a circle, and wanted to find a point that was 2 total units away in a specific direction (meaning one way around the circle), how would I go about doing this? By 2 total units I mean 1 unit in the x direction, one in the y, OR 1.5 in the x, 0.5 in the y, or any other combination that results in a 2 when their absolute values are added.
 
Since you talk about "x direction" and "y direction" you are talking about a Cartesian coordinate system. Any point on a circle with center at \(\displaystyle (x_0, y_0)\) and radius R has coordinates (x, y) such that \(\displaystyle (x- x_0)^2+ (y- y_0)^2= R^2\).

Now, you want to change x by some number "a" and y by "2- a" so the new point is \(\displaystyle (x+ a, y+ 2- a)\). Do you want to find a such that this new point is also on the circle? If so you want \(\displaystyle (x+ a- x_0)^2+ (y+ 2- a- y_0)^2= R^2\). Write that as \(\displaystyle ((x- x_0)- a)^2+ ((y- y_0)+ (2- a))^2= R^2\) and do the multiplications:

\(\displaystyle (x- x_0)^2- 2a(x- x_0)+ a^2+ (y- y_0)^2- 2(2- a)(y- y_0)+(2+ a)^2= R^2\).

Since \(\displaystyle (x- x_0)^2+ (y- y_0)^2= R^2\)

that reduces to

\(\displaystyle a^2- 2a(x- x_0)+ a^2- 2(2- a)(y- y_0)= R^2\).

\(\displaystyle 2a^2- (2(x- x_0)+ 2(y- y_0))a- 4(y- y_0)- R^2= 0\)

Solve that for a.
 
Since you talk about "x direction" and "y direction" you are talking about a Cartesian coordinate system. Any point on a circle with center at \(\displaystyle (x_0, y_0)\) and radius R has coordinates (x, y) such that \(\displaystyle (x- x_0)^2+ (y- y_0)^2= R^2\).

Now, you want to change x by some number "a" and y by "2- a" so the new point is \(\displaystyle (x+ a, y+ 2- a)\). Do you want to find a such that this new point is also on the circle? If so you want \(\displaystyle (x+ a- x_0)^2+ (y+ 2- a- y_0)^2= R^2\). Write that as \(\displaystyle ((x- x_0)- a)^2+ ((y- y_0)+ (2- a))^2= R^2\) and do the multiplications:

\(\displaystyle (x- x_0)^2- 2a(x- x_0)+ a^2+ (y- y_0)^2- 2(2- a)(y- y_0)+(2+ a)^2= R^2\).

Since \(\displaystyle (x- x_0)^2+ (y- y_0)^2= R^2\)

that reduces to

\(\displaystyle a^2- 2a(x- x_0)+ a^2- 2(2- a)(y- y_0)= R^2\).

\(\displaystyle 2a^2- (2(x- x_0)+ 2(y- y_0))a- 4(y- y_0)- R^2= 0\)

Solve that for a.
So I'm not quite sure how to use this. My intention was to be able to find another point on the circle that is 2 units away, could you walk me through a problem/link a video or something doing this? Thanks!
 
So I'm not quite sure how to use this. My intention was to be able to find another point on the circle that is 2 units away, could you walk me through a problem/link a video or something doing this? Thanks!

I'm wondering why you want a "distance" measured as you do, rather than the actual (Euclidean) distance. Possibly if we knew the reason, we could suggest a better approach to your goal. As it seems unusual, I doubt you would find a video or other source that would apply; as it stands, the algebra that was suggested seems like the only way to go. Are you suggesting that your algebra is a little weak, and you don't want to undertake it?

Well, I see a slightly different algebraic approach: the set of all points at a "distance" d from a given point forms a diamond shape around the point. The direction you want to go determines (mostly) one line that you need to intersect with the circle to find the desired point. I think this perspective is likely to be very helpful in coding, so it's worth the effort.
 
I'm wondering why you want a "distance" measured as you do, rather than the actual (Euclidean) distance. Possibly if we knew the reason, we could suggest a better approach to your goal. As it seems unusual, I doubt you would find a video or other source that would apply; as it stands, the algebra that was suggested seems like the only way to go. Are you suggesting that your algebra is a little weak, and you don't want to undertake it?

Well, I see a slightly different algebraic approach: the set of all points at a "distance" d from a given point forms a diamond shape around the point. The direction you want to go determines (mostly) one line that you need to intersect with the circle to find the desired point. I think this perspective is likely to be very helpful in coding, so it's worth the effort.
I'm more suggesting my algebra is weak. I messed around with it a little, using a graphing calculator and some sample numbers, but I didn't really get what I was looking for. My intention is to graph out a circle, with the points on that circle being the only points that an entity to move to. I wanted it to be able to only move a certain distance each turn, setting it at a certain (unchanging) speed.
 
Would it be good enough if the point moved around the circle by the same angle each time, like this?

1598491468871.png

What you requested would look more like this, with different amount of rotation each time (sizes are exaggerated):
1598492023743.png
 
Would it be good enough if the point moved around the circle by the same angle each time, like this?

View attachment 21223

What you requested would look more like this, with different amount of rotation each time (sizes are exaggerated):
View attachment 21224
That would probably be fine, I just don't want the distance it travels each time to differ too much. If the difference is basically negligible, it should be fine. How would I go about doing the first circle you depicted?
 
The details depend on what you know, and how you are coding it. (And if you want the distances not to vary much, in every case, then you should go with the first way.)

If you know the center and radius of the circle, and the starting point, and the literal distance (chord) you want from one point on the circle to the next, then one way would be to use trigonometry. Find the angle from the center to the starting point; find the angle subtended by each chord; and just successively add that angle to the starting angle to find each point.

This assumes that you know at least a little trigonometry (and if you are coding anything graphical, you will need to!).
 
The details depend on what you know, and how you are coding it. (And if you want the distances not to vary much, in every case, then you should go with the first way.)

If you know the center and radius of the circle, and the starting point, and the literal distance (chord) you want from one point on the circle to the next, then one way would be to use trigonometry. Find the angle from the center to the starting point; find the angle subtended by each chord; and just successively add that angle to the starting angle to find each point.

This assumes that you know at least a little trigonometry (and if you are coding anything graphical, you will need to!).
Ok thanks. I believe I know how to do this.
 
Top