title: Point Inside Circle Collision Response: How do you keep the Point inside of the circle?
body: <p><img src="https://i.imgur.com/u7xrW.png" alt="Diagram of the meaning of this question."></p>
  
  <p>I have given a diagram of my current small problem that I need help with. My main purpose is to keep the point from going <strong>outside</strong> the circle. Nothing else.</p>
  
  <p>The center of the circle is positioned at (x, y).</p>
  
  <p>I only solved a little bit of the problem, and that is the collision detection part of my problem, as given below:</p>
  
  <pre><code>public void bound(Point p, Circle c){
      double distance = Math.hypot(p.x - c.x, p.y - c.y);
      if (distance &gt;= c.radius){
          //Clueless from here on out.
      }
  }
  </code></pre>
  
  <p>The part where I left a comment is the spot I couldn't figure anything out. I did tried to set the point's <code>velocityX</code> and <code>velocityY</code> to 0, but I realized the point will just stay put whenever it touches the circle.</p>
  
  <p>So, I'm sort of stuck.</p>