title: Plotting Lagrange points
body: <p>I am trying to find the 5 Lagrange points of the Three-Body system by plotting the given potential function in Matlab. The only thing is that I'm not very good at programming. Any assistance would be greatly appreciated. What I want to know is how to make this code give me a decent contour plot:</p>
  
  <pre><code>function Lagrange(a)
  
  
  x = ( -10000: 1 : 10000);
  y = ( -10000: 1 : 10000);
  Potential = zeros(length(x));
  
  for i = 1: length(x)
      for j = 1 : length(y)
  
      Potential(i,j) =  ( 1 - a ) / sqrt( ( x(i) - a )^2 + y(j)^2)  + a / sqrt( ( x(i) + 1    - a )^2 + y(j)^2 ) + ( x(i)^2 + y(j)^2 ) / 2 ;
  
      end
  
      j = 1;
  end
  
  contour(Potential);
  
  xlabel('X axis'); 
  ylabel('Y axis'); 
  zlabel('Z axis');
  </code></pre>