Is there an algorithm or formula to find the alignment of multiple points?
up vote
3
down vote
favorite
Dear math stackexchange community,
Is there a way to calculate the alignment of multiple points?
If this is a broad question, think of planets, it is the same principle.
Example:
Given three points {B,C,D} with each the same circumference. (in the picture below they all have different diameters, but it is just for visual purposes)
Let's use the universe as inspiration and assume that the closer the point is to the center (or sun), in this example {A}. The closer it is, the faster it goes:
B increments with 3 (degrees, steps, you name it...)
C increments with 2
D increments with 1
How many steps/rotations/etc. will it take for {B,C,D} to be aligned (to have the same value)?
So wanted result:
I have programmed this in Python, but I'm looking for a formula or way to predict it, without having the program iterate (looping) forever so to speak...
Any ideas or suggestions are welcome, thanks!
circle rotations
add a comment |
up vote
3
down vote
favorite
Dear math stackexchange community,
Is there a way to calculate the alignment of multiple points?
If this is a broad question, think of planets, it is the same principle.
Example:
Given three points {B,C,D} with each the same circumference. (in the picture below they all have different diameters, but it is just for visual purposes)
Let's use the universe as inspiration and assume that the closer the point is to the center (or sun), in this example {A}. The closer it is, the faster it goes:
B increments with 3 (degrees, steps, you name it...)
C increments with 2
D increments with 1
How many steps/rotations/etc. will it take for {B,C,D} to be aligned (to have the same value)?
So wanted result:
I have programmed this in Python, but I'm looking for a formula or way to predict it, without having the program iterate (looping) forever so to speak...
Any ideas or suggestions are welcome, thanks!
circle rotations
If the speeds are rational fractions of the circumferences, then you are looking for the Chinese Remainder Theorem. If any of the speeds is an irrational fraction, then they may never perfectly align, but they will still occasionally come very close.
– Paul Sinclair
Nov 21 at 4:43
@Paul Sinclair Could you elaborate on this please?
– Eli
Nov 21 at 23:49
add a comment |
up vote
3
down vote
favorite
up vote
3
down vote
favorite
Dear math stackexchange community,
Is there a way to calculate the alignment of multiple points?
If this is a broad question, think of planets, it is the same principle.
Example:
Given three points {B,C,D} with each the same circumference. (in the picture below they all have different diameters, but it is just for visual purposes)
Let's use the universe as inspiration and assume that the closer the point is to the center (or sun), in this example {A}. The closer it is, the faster it goes:
B increments with 3 (degrees, steps, you name it...)
C increments with 2
D increments with 1
How many steps/rotations/etc. will it take for {B,C,D} to be aligned (to have the same value)?
So wanted result:
I have programmed this in Python, but I'm looking for a formula or way to predict it, without having the program iterate (looping) forever so to speak...
Any ideas or suggestions are welcome, thanks!
circle rotations
Dear math stackexchange community,
Is there a way to calculate the alignment of multiple points?
If this is a broad question, think of planets, it is the same principle.
Example:
Given three points {B,C,D} with each the same circumference. (in the picture below they all have different diameters, but it is just for visual purposes)
Let's use the universe as inspiration and assume that the closer the point is to the center (or sun), in this example {A}. The closer it is, the faster it goes:
B increments with 3 (degrees, steps, you name it...)
C increments with 2
D increments with 1
How many steps/rotations/etc. will it take for {B,C,D} to be aligned (to have the same value)?
So wanted result:
I have programmed this in Python, but I'm looking for a formula or way to predict it, without having the program iterate (looping) forever so to speak...
Any ideas or suggestions are welcome, thanks!
circle rotations
circle rotations
asked Nov 20 at 20:10
Eli
1534
1534
If the speeds are rational fractions of the circumferences, then you are looking for the Chinese Remainder Theorem. If any of the speeds is an irrational fraction, then they may never perfectly align, but they will still occasionally come very close.
– Paul Sinclair
Nov 21 at 4:43
@Paul Sinclair Could you elaborate on this please?
– Eli
Nov 21 at 23:49
add a comment |
If the speeds are rational fractions of the circumferences, then you are looking for the Chinese Remainder Theorem. If any of the speeds is an irrational fraction, then they may never perfectly align, but they will still occasionally come very close.
– Paul Sinclair
Nov 21 at 4:43
@Paul Sinclair Could you elaborate on this please?
– Eli
Nov 21 at 23:49
If the speeds are rational fractions of the circumferences, then you are looking for the Chinese Remainder Theorem. If any of the speeds is an irrational fraction, then they may never perfectly align, but they will still occasionally come very close.
– Paul Sinclair
Nov 21 at 4:43
If the speeds are rational fractions of the circumferences, then you are looking for the Chinese Remainder Theorem. If any of the speeds is an irrational fraction, then they may never perfectly align, but they will still occasionally come very close.
– Paul Sinclair
Nov 21 at 4:43
@Paul Sinclair Could you elaborate on this please?
– Eli
Nov 21 at 23:49
@Paul Sinclair Could you elaborate on this please?
– Eli
Nov 21 at 23:49
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
It was late when I left that comment and I was heading to bed, so I hadn't thought beyond the general idea. The chinese remainder theorem is only applicable to a limited number of cases. More generally, one has to solve a system of linear Diophantine equations.
Label the points $1$ to $k$, and let $x_i(t)$ be the position of the $i$-th point at time $t$, in revolutions. Thus as the point moves around the circle, $x_i$ raises from $0$ to $1$, except that after a full revolution where it would be $1$, instead it drops back to $0$.
Now at $t = 0$, each of the points is in some known starting position $r_i := x_i(0)$. And each point is moving at its own constant speed $s_i$. Therefore,
$$x_i(t) equiv r_i + s_it mod 1$$
$x_i(t)$ will be the same for all $i$ when the points are aligned. By subtracting the $k$-th equivalence from the others, we have at the alignment
$$(s_i - s_k)t equiv r_k - r_i mod 1$$ for all $i < k$.
Now suppose that all the values are rational numbers. If we multiply each of these equivalences by its least common denominator $n_i$, we have:
$$m_it equiv a_i mod n_i$$for all $i < k$, where $m_i = n_i(s_i - s_k)$ and $a_i = n_i(r_k - r_i)$.
By solving this system of linear Diophantine equations, you can find the times $t$ where your points are aligned.
This also works when all of the $s_i, r_i$ are rational multiples of the same irrational number $xi$. But if there at least 3 points and the ratios of the various speeds and initial positions are not rational, then it is quite possible that the points will never exactly align. But since you can find rational approximations to irrational numbers to any desired precision, you can still use the rational method above to find near-alignments.
Even in the case where the values are all rational numbers, the possibility of alignment will depend on the starting positions. In general, we can never expect precise alignment of three or more points, unless the starting positions are special.
– TonyK
Nov 22 at 1:41
@TonyK - yes, I left the conditions for solutions to exist to the wikipedia article. However, if you were to choose the rational values uniformly from a large sample of rational values, the odds of picking choices with no solution are low. (However, from a small sample, such as we usually use when making examples, it is quite easy to find one with no solutions.)
– Paul Sinclair
Nov 22 at 1:48
Hmm interesting, and how exactly would it work using the chinese remainder theorem?
– Eli
Nov 22 at 6:16
@Eli - I started out by noting that the chinese remainder theorem is only useful in a limited number of cases. If $m_i$ is relatively prime to $n_i$, then it has a modular inverse - that is, an integer $m_i'$ such that $m_i'm_i equiv 1 mod n_i$, which allows you to rewrite the $i$-th condition as $t equiv m_i'a_i mod n_i$. If this is true for all $i < k$, then you can use the chinese remainder theorem to find the solution. If not, then you will need the more general techniques discussed in the link.
– Paul Sinclair
Nov 22 at 14:07
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
It was late when I left that comment and I was heading to bed, so I hadn't thought beyond the general idea. The chinese remainder theorem is only applicable to a limited number of cases. More generally, one has to solve a system of linear Diophantine equations.
Label the points $1$ to $k$, and let $x_i(t)$ be the position of the $i$-th point at time $t$, in revolutions. Thus as the point moves around the circle, $x_i$ raises from $0$ to $1$, except that after a full revolution where it would be $1$, instead it drops back to $0$.
Now at $t = 0$, each of the points is in some known starting position $r_i := x_i(0)$. And each point is moving at its own constant speed $s_i$. Therefore,
$$x_i(t) equiv r_i + s_it mod 1$$
$x_i(t)$ will be the same for all $i$ when the points are aligned. By subtracting the $k$-th equivalence from the others, we have at the alignment
$$(s_i - s_k)t equiv r_k - r_i mod 1$$ for all $i < k$.
Now suppose that all the values are rational numbers. If we multiply each of these equivalences by its least common denominator $n_i$, we have:
$$m_it equiv a_i mod n_i$$for all $i < k$, where $m_i = n_i(s_i - s_k)$ and $a_i = n_i(r_k - r_i)$.
By solving this system of linear Diophantine equations, you can find the times $t$ where your points are aligned.
This also works when all of the $s_i, r_i$ are rational multiples of the same irrational number $xi$. But if there at least 3 points and the ratios of the various speeds and initial positions are not rational, then it is quite possible that the points will never exactly align. But since you can find rational approximations to irrational numbers to any desired precision, you can still use the rational method above to find near-alignments.
Even in the case where the values are all rational numbers, the possibility of alignment will depend on the starting positions. In general, we can never expect precise alignment of three or more points, unless the starting positions are special.
– TonyK
Nov 22 at 1:41
@TonyK - yes, I left the conditions for solutions to exist to the wikipedia article. However, if you were to choose the rational values uniformly from a large sample of rational values, the odds of picking choices with no solution are low. (However, from a small sample, such as we usually use when making examples, it is quite easy to find one with no solutions.)
– Paul Sinclair
Nov 22 at 1:48
Hmm interesting, and how exactly would it work using the chinese remainder theorem?
– Eli
Nov 22 at 6:16
@Eli - I started out by noting that the chinese remainder theorem is only useful in a limited number of cases. If $m_i$ is relatively prime to $n_i$, then it has a modular inverse - that is, an integer $m_i'$ such that $m_i'm_i equiv 1 mod n_i$, which allows you to rewrite the $i$-th condition as $t equiv m_i'a_i mod n_i$. If this is true for all $i < k$, then you can use the chinese remainder theorem to find the solution. If not, then you will need the more general techniques discussed in the link.
– Paul Sinclair
Nov 22 at 14:07
add a comment |
up vote
1
down vote
It was late when I left that comment and I was heading to bed, so I hadn't thought beyond the general idea. The chinese remainder theorem is only applicable to a limited number of cases. More generally, one has to solve a system of linear Diophantine equations.
Label the points $1$ to $k$, and let $x_i(t)$ be the position of the $i$-th point at time $t$, in revolutions. Thus as the point moves around the circle, $x_i$ raises from $0$ to $1$, except that after a full revolution where it would be $1$, instead it drops back to $0$.
Now at $t = 0$, each of the points is in some known starting position $r_i := x_i(0)$. And each point is moving at its own constant speed $s_i$. Therefore,
$$x_i(t) equiv r_i + s_it mod 1$$
$x_i(t)$ will be the same for all $i$ when the points are aligned. By subtracting the $k$-th equivalence from the others, we have at the alignment
$$(s_i - s_k)t equiv r_k - r_i mod 1$$ for all $i < k$.
Now suppose that all the values are rational numbers. If we multiply each of these equivalences by its least common denominator $n_i$, we have:
$$m_it equiv a_i mod n_i$$for all $i < k$, where $m_i = n_i(s_i - s_k)$ and $a_i = n_i(r_k - r_i)$.
By solving this system of linear Diophantine equations, you can find the times $t$ where your points are aligned.
This also works when all of the $s_i, r_i$ are rational multiples of the same irrational number $xi$. But if there at least 3 points and the ratios of the various speeds and initial positions are not rational, then it is quite possible that the points will never exactly align. But since you can find rational approximations to irrational numbers to any desired precision, you can still use the rational method above to find near-alignments.
Even in the case where the values are all rational numbers, the possibility of alignment will depend on the starting positions. In general, we can never expect precise alignment of three or more points, unless the starting positions are special.
– TonyK
Nov 22 at 1:41
@TonyK - yes, I left the conditions for solutions to exist to the wikipedia article. However, if you were to choose the rational values uniformly from a large sample of rational values, the odds of picking choices with no solution are low. (However, from a small sample, such as we usually use when making examples, it is quite easy to find one with no solutions.)
– Paul Sinclair
Nov 22 at 1:48
Hmm interesting, and how exactly would it work using the chinese remainder theorem?
– Eli
Nov 22 at 6:16
@Eli - I started out by noting that the chinese remainder theorem is only useful in a limited number of cases. If $m_i$ is relatively prime to $n_i$, then it has a modular inverse - that is, an integer $m_i'$ such that $m_i'm_i equiv 1 mod n_i$, which allows you to rewrite the $i$-th condition as $t equiv m_i'a_i mod n_i$. If this is true for all $i < k$, then you can use the chinese remainder theorem to find the solution. If not, then you will need the more general techniques discussed in the link.
– Paul Sinclair
Nov 22 at 14:07
add a comment |
up vote
1
down vote
up vote
1
down vote
It was late when I left that comment and I was heading to bed, so I hadn't thought beyond the general idea. The chinese remainder theorem is only applicable to a limited number of cases. More generally, one has to solve a system of linear Diophantine equations.
Label the points $1$ to $k$, and let $x_i(t)$ be the position of the $i$-th point at time $t$, in revolutions. Thus as the point moves around the circle, $x_i$ raises from $0$ to $1$, except that after a full revolution where it would be $1$, instead it drops back to $0$.
Now at $t = 0$, each of the points is in some known starting position $r_i := x_i(0)$. And each point is moving at its own constant speed $s_i$. Therefore,
$$x_i(t) equiv r_i + s_it mod 1$$
$x_i(t)$ will be the same for all $i$ when the points are aligned. By subtracting the $k$-th equivalence from the others, we have at the alignment
$$(s_i - s_k)t equiv r_k - r_i mod 1$$ for all $i < k$.
Now suppose that all the values are rational numbers. If we multiply each of these equivalences by its least common denominator $n_i$, we have:
$$m_it equiv a_i mod n_i$$for all $i < k$, where $m_i = n_i(s_i - s_k)$ and $a_i = n_i(r_k - r_i)$.
By solving this system of linear Diophantine equations, you can find the times $t$ where your points are aligned.
This also works when all of the $s_i, r_i$ are rational multiples of the same irrational number $xi$. But if there at least 3 points and the ratios of the various speeds and initial positions are not rational, then it is quite possible that the points will never exactly align. But since you can find rational approximations to irrational numbers to any desired precision, you can still use the rational method above to find near-alignments.
It was late when I left that comment and I was heading to bed, so I hadn't thought beyond the general idea. The chinese remainder theorem is only applicable to a limited number of cases. More generally, one has to solve a system of linear Diophantine equations.
Label the points $1$ to $k$, and let $x_i(t)$ be the position of the $i$-th point at time $t$, in revolutions. Thus as the point moves around the circle, $x_i$ raises from $0$ to $1$, except that after a full revolution where it would be $1$, instead it drops back to $0$.
Now at $t = 0$, each of the points is in some known starting position $r_i := x_i(0)$. And each point is moving at its own constant speed $s_i$. Therefore,
$$x_i(t) equiv r_i + s_it mod 1$$
$x_i(t)$ will be the same for all $i$ when the points are aligned. By subtracting the $k$-th equivalence from the others, we have at the alignment
$$(s_i - s_k)t equiv r_k - r_i mod 1$$ for all $i < k$.
Now suppose that all the values are rational numbers. If we multiply each of these equivalences by its least common denominator $n_i$, we have:
$$m_it equiv a_i mod n_i$$for all $i < k$, where $m_i = n_i(s_i - s_k)$ and $a_i = n_i(r_k - r_i)$.
By solving this system of linear Diophantine equations, you can find the times $t$ where your points are aligned.
This also works when all of the $s_i, r_i$ are rational multiples of the same irrational number $xi$. But if there at least 3 points and the ratios of the various speeds and initial positions are not rational, then it is quite possible that the points will never exactly align. But since you can find rational approximations to irrational numbers to any desired precision, you can still use the rational method above to find near-alignments.
answered Nov 22 at 1:32
Paul Sinclair
18.9k21440
18.9k21440
Even in the case where the values are all rational numbers, the possibility of alignment will depend on the starting positions. In general, we can never expect precise alignment of three or more points, unless the starting positions are special.
– TonyK
Nov 22 at 1:41
@TonyK - yes, I left the conditions for solutions to exist to the wikipedia article. However, if you were to choose the rational values uniformly from a large sample of rational values, the odds of picking choices with no solution are low. (However, from a small sample, such as we usually use when making examples, it is quite easy to find one with no solutions.)
– Paul Sinclair
Nov 22 at 1:48
Hmm interesting, and how exactly would it work using the chinese remainder theorem?
– Eli
Nov 22 at 6:16
@Eli - I started out by noting that the chinese remainder theorem is only useful in a limited number of cases. If $m_i$ is relatively prime to $n_i$, then it has a modular inverse - that is, an integer $m_i'$ such that $m_i'm_i equiv 1 mod n_i$, which allows you to rewrite the $i$-th condition as $t equiv m_i'a_i mod n_i$. If this is true for all $i < k$, then you can use the chinese remainder theorem to find the solution. If not, then you will need the more general techniques discussed in the link.
– Paul Sinclair
Nov 22 at 14:07
add a comment |
Even in the case where the values are all rational numbers, the possibility of alignment will depend on the starting positions. In general, we can never expect precise alignment of three or more points, unless the starting positions are special.
– TonyK
Nov 22 at 1:41
@TonyK - yes, I left the conditions for solutions to exist to the wikipedia article. However, if you were to choose the rational values uniformly from a large sample of rational values, the odds of picking choices with no solution are low. (However, from a small sample, such as we usually use when making examples, it is quite easy to find one with no solutions.)
– Paul Sinclair
Nov 22 at 1:48
Hmm interesting, and how exactly would it work using the chinese remainder theorem?
– Eli
Nov 22 at 6:16
@Eli - I started out by noting that the chinese remainder theorem is only useful in a limited number of cases. If $m_i$ is relatively prime to $n_i$, then it has a modular inverse - that is, an integer $m_i'$ such that $m_i'm_i equiv 1 mod n_i$, which allows you to rewrite the $i$-th condition as $t equiv m_i'a_i mod n_i$. If this is true for all $i < k$, then you can use the chinese remainder theorem to find the solution. If not, then you will need the more general techniques discussed in the link.
– Paul Sinclair
Nov 22 at 14:07
Even in the case where the values are all rational numbers, the possibility of alignment will depend on the starting positions. In general, we can never expect precise alignment of three or more points, unless the starting positions are special.
– TonyK
Nov 22 at 1:41
Even in the case where the values are all rational numbers, the possibility of alignment will depend on the starting positions. In general, we can never expect precise alignment of three or more points, unless the starting positions are special.
– TonyK
Nov 22 at 1:41
@TonyK - yes, I left the conditions for solutions to exist to the wikipedia article. However, if you were to choose the rational values uniformly from a large sample of rational values, the odds of picking choices with no solution are low. (However, from a small sample, such as we usually use when making examples, it is quite easy to find one with no solutions.)
– Paul Sinclair
Nov 22 at 1:48
@TonyK - yes, I left the conditions for solutions to exist to the wikipedia article. However, if you were to choose the rational values uniformly from a large sample of rational values, the odds of picking choices with no solution are low. (However, from a small sample, such as we usually use when making examples, it is quite easy to find one with no solutions.)
– Paul Sinclair
Nov 22 at 1:48
Hmm interesting, and how exactly would it work using the chinese remainder theorem?
– Eli
Nov 22 at 6:16
Hmm interesting, and how exactly would it work using the chinese remainder theorem?
– Eli
Nov 22 at 6:16
@Eli - I started out by noting that the chinese remainder theorem is only useful in a limited number of cases. If $m_i$ is relatively prime to $n_i$, then it has a modular inverse - that is, an integer $m_i'$ such that $m_i'm_i equiv 1 mod n_i$, which allows you to rewrite the $i$-th condition as $t equiv m_i'a_i mod n_i$. If this is true for all $i < k$, then you can use the chinese remainder theorem to find the solution. If not, then you will need the more general techniques discussed in the link.
– Paul Sinclair
Nov 22 at 14:07
@Eli - I started out by noting that the chinese remainder theorem is only useful in a limited number of cases. If $m_i$ is relatively prime to $n_i$, then it has a modular inverse - that is, an integer $m_i'$ such that $m_i'm_i equiv 1 mod n_i$, which allows you to rewrite the $i$-th condition as $t equiv m_i'a_i mod n_i$. If this is true for all $i < k$, then you can use the chinese remainder theorem to find the solution. If not, then you will need the more general techniques discussed in the link.
– Paul Sinclair
Nov 22 at 14:07
add a comment |
Thanks for contributing an answer to Mathematics Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3006823%2fis-there-an-algorithm-or-formula-to-find-the-alignment-of-multiple-points%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
If the speeds are rational fractions of the circumferences, then you are looking for the Chinese Remainder Theorem. If any of the speeds is an irrational fraction, then they may never perfectly align, but they will still occasionally come very close.
– Paul Sinclair
Nov 21 at 4:43
@Paul Sinclair Could you elaborate on this please?
– Eli
Nov 21 at 23:49