why result from calculator as not equal as from program?

edited March 2016 in Questions about Code

Hi, I confuse about the result from calculator not equal from promgram. How about round float number in processing.

Calculate with MS excel 1

Calculate with Procesing

22

Below is my code.

float A,B,C;

void setup(){
  size(300,300);
  A=-7;
  B=6;
  C=-5;
  float r = sqrt(sq(A)+sq(B)+sq(C));
  float t = degrees(atan(sqrt((sq(A)+sq(B)))/C));
  float p = degrees(atan(B/A));
  println(r,t,p);

}

Answers

Sign In or Register to comment.