title: Checking if a triangle is a right triangle
body: <p>I'm trying to check to see if a triangle is a right triangle in Java.
  This is a portion of what the tester class does:</p>
  
  <pre><code>    Triangle a = new Triangle(new Point(2, 2), new Point(6, 2), new Point(2, 6) );
      System.out.println(a.isRight()); //Expects True
  </code></pre>
  
  <p>A portion of my triangle class receives the values and sets them to x1,y2 etc:</p>
  
  <pre><code>    public Triangle(Point loc1, Point loc2, Point loc3) {
      x1 =  loc1.getX(); y1 =  loc1.getY();
      . . .
  </code></pre>
  
  <p>The first two segments of code were given to me. I am to make the last segment of code which I made to be this:</p>
  
  <pre><code>    public boolean isRight() {
          if((Math.pow(side1,2)+Math.pow(side2,2)) == Math.pow(side3,2))
              return true;
          if((Math.pow(side2,2)+Math.pow(side1,2)) == Math.pow(side3,2))
              return true;
          if((Math.pow(side3,2)+Math.pow(side2,2)) == Math.pow(side1,2))
              return true;
          else
              return false;
      }
  </code></pre>
  
  <p>However, it still returns false. What am I doing wrong?
  Thanks a bunch!</p>
  
  <p>Update:
  Thanks for the help. I seem to have made a rather noob-ish mistake. I never thought about the fact that doubles weren't really accurate (sorry, just trying to say what I did in simple terms). I ended up inputting this:</p>
  
  <pre><code>        if(Math.abs(side1*side1 + side2*side2 - side3*side3) &lt; 0.2)
          return true;
      if(Math.abs(side1*side1 + side3*side3 - side2*side2) &lt; 0.2)
          return true;
      if(Math.abs(side3*side3 + side2*side2 - side1*side1) &lt; 0.2)
          return true;
      else
          return false;
  </code></pre>
  
  <p>Once again, thanks for the help!</p>