title: Flocking separation rule
body: <pre><code>-(CGPoint)Rule2:(Boid*)b
      {
          CGPoint v = CGPointMake(0, 0);
  
          for (Boid *boid in ActiveBoids)
          {
              if (boid != b)
              {
                  NSLog(@"%f", [Utilities Magnitude:boid.position] - [Utilities Magnitude:b.position]);
                  if(([Utilities Magnitude:boid.position] - [Utilities Magnitude:b.position]) &lt; 150)
                  {
                      v = [Utilities MinusVector:v Vector2:CGPointMake(boid.position.x - b.position.x, boid.position.y - b.position.y)];
                      NSLog(@"%f", v.x);
                      NSLog(@"%f", v.y);
                  }
              }
          }
          return v;
      }
  </code></pre>
  
  <p>My magnitude and subtract methods both work fine:</p>
  
  <pre><code>+ (CGPoint)MinusVector:(CGPoint)v1 Vector2:(CGPoint)v2
  {
      return CGPointMake(v1.x - v2.x, v1.y - v2.y);
  }
  
  + (float)Magnitude:(CGPoint)p1
  {
      return hypot(p1.x, p1.y);
  }
  </code></pre>
  
  <p>For some reason this is my output from that method:</p>
  
  <p><a href="http://pastebin.com/3xGGEkF2" rel="nofollow">Error Log</a></p>
  
  <p>I've been looking at this for too long to see what's wrong. Any ideas?</p>