We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi, I confuse about the result from calculator not equal from promgram. How about round float number in processing.
Calculate with MS excel
Calculate with Procesing
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
Use datatype
double
+ class Math:This has been answered before ;)