title: How can I fix these multiple problems that deal with slope?
body: <p>I want to make a little piece of code that makes and ellipse go toward another point.</p>
  
  <p>The principle is simple enough:</p>
  
  <pre><code>int ellipseX = 30;
  int ellipseY = 30;
  int ellipse1X = MouseInfo.getPointerInfo().getLocation().x;
  int ellipse1Y = MouseInfo.getPointerInfo().getLocation().y;
  //m=(y2-y1)/(x2-x1)
  double slopex = ellipse1X/ellipseX;
  double slopey = ellipse1Y/ellipseY;
  public void paintComponent(Graphics g){
      g.fillOval(ellipseX, ellipseY, 4, 4);
      ellipseX+=slopex;
      ellipseY+=slopey;
      repaint();
  }
  </code></pre>
  
  <p>Now there are a couple of problems with that-</p>
  
  <ul>
  <li><p>double + int = double making it unable to be a possible "x" or "y" for the ellipse.</p></li>
  <li><p>Slope doesn't update so that it only goes in that direction and stays that way.</p></li>
  </ul>
  
  <p>And a whole bunch of problems besides. How can I fix this?</p>