title: Finding Sides/Angles of a triangle
body: <p>I'm attempting to find the angles/sides of a triangle based on points that are scanned in.</p>
  
  <p>So, sides are calculated, then angles. My side lengths seem to be correct, however I keep getting the wrong value for the angle. The values being used for the formula are supposed to be "height = 3" and "sideA = 3.16." Now, if I input those values directly, I get the correct result.. If I use my height and sideA variables, I get an incorrect result even though those are outputting the correct values.</p>
  
  <p>Value with input of "3/3.16" = .949763-------------------------------------------------------------------------------
  Value with input of "height/sideA" = .74999</p>
  
  <p>EDIT: Point values are "(0.0,0.0) (4.0,0.0) (3.0,3.0)"</p>
  
  <pre><code>public class Triangle {
  
  private double sideA;
  private double sideB;
  private double sideC;
  private double height;
  private double x1;
  private double y1;
  private double x2;
  private double y2;
  private double x3;
  private double y3;
  
  
  
  public void setX1( double x){
  
    x1 = x;
  
  }
  
  public void setY1( double y){
  
    y1 = y;
  
  }
  
  public void setX2( double x){
  
    x2 = x;
  
  }
  
  public void setY2( double y){
  
    y2 = y;
  
  }
  
  public void setX3( double x){
  
    x3 = x;
  
  }
  
  public void setY3(double y){
  
    y3 = y;
  
  }
  
  public void setHeight(){
  
    height = (x3 - x1);
  
  }
  
  public double getHeight() {
  
    return height;
  
  }
  
  public void setLengthC(){
  
  sideA = Math.sqrt(
          Math.pow((x2 - x1), 2.0)
        + Math.pow((y2 - y1), 2.0));
  }
  
  public double getLengthC(){
  
    return sideA;
  
  }
  
  
  public double getAngleA() {
  
    double sine = Math.asin(Math.sin(height/sideA));
    return sine;
  
  }
  
  
  }
  </code></pre>
  
  <p>And here is the tester class.</p>
  
  <pre><code> import java.util.*;
  
  
  public class TriangleTester {
  
     public static void main(String [] args){
  
     Scanner scan = new Scanner(System.in);
     Triangle test = new Triangle();
  
  
  
     System.out.print("Please enter a value for X1: ");
     test.setX1(scan.nextDouble());
     System.out.print("Please enter a value for Y1: ");
     test.setY1(scan.nextDouble()); 
     System.out.print("Please enter a value for X2: ");   
     test.setX2(scan.nextDouble()); 
     System.out.print("Please enter a value for Y2: ");
     test.setY2(scan.nextDouble()); 
     System.out.print("Please enter a value for X3: ");   
     test.setX3(scan.nextDouble()); 
     System.out.print("Please enter a value for Y3: ");
     test.setY3(scan.nextDouble());
     test.setLengthC();
     test.setHeight();
  
     System.out.println("Side a: " + test.getLengthA());
     System.out.println("Side b: " + test.getLengthB());
     System.out.println("Side c: " + test.getLengthC());
     System.out.println("Height: " + test.getHeight());
     System.out.println("Angle A: " + test.getAngleA());
  
  
  
      }
      }  
  </code></pre>