title: Inverse of modulo operator in Python
body: <p>I’m trying to solve the following set of equations for <code>time</code> in Python:</p>
  
  <pre><code>position1 = (initial_position1 + (time * velocity1)) % 360
  position2 = (initial_position2 + (time * velocity2)) % 360
  </code></pre>
  
  <p>There are two objects revolving around a center point in the same direction, with different speed, and with possibly different starting points (ie. their position at a given time). I’d like to know how much time does it take for the two objects to meet.</p>
  
  <p>For this, I have this equation:</p>
  
  <pre><code>(initial_position1 + (time * velocity1)) % 360 == (initial_position2 + (time * velocity2)) % 360
  </code></pre>
  
  <p>But I cannot solve it for <code>time</code> as there is no inverse function for the <code>%</code> operator. Is there a known solution for this? If not, any advice would come in handy.</p>