Anonymous user
Trigonometric functions: Difference between revisions
no edit summary
(Logo) |
No edit summary |
||
Line 115:
int main() {
double Pi = 4.0 * atan(1.0); // in D math module, PI is a _real_ constant of
/*Pi / 4 is 45 degrees. All answers should be the same.*/
double radians = Pi / 4.0;
Line 139:
}</d>
=={{header|Forth}}==
45e pi f* 180e f/
cr fdup fsin f.
cr fdup fcos f.
cr fdup ftan f.
cr fdup fasin f.
cr fdup facos f.
cr fatan f.
=={{header|Haskell}}==
Line 222:
<java>public class Trig {
}
}</java>
Line 321:
0.785398163397448 45
0.785398163397448 45
</pre>
=={{header|Pop11}}==
Pop11 trigonometric functions accept both degrees and radians.
In default mode argument is in degrees, after setting 'popradians'
flag to 'true' arguments are in radians.
<pre>
sin(30) =>
cos(45) =>
tan(45) =>
arcsin(0.7) =>
arccos(0.7) =>
arctan(0.7) =>
;;; switch to radians
true -> popradians;
sin(pi*30/180) =>
cos(pi*45/180) =>
tan(pi*45/180) =>
arcsin(0.7) =>
arccos(0.7) =>
arctan(0.7) =>
</pre>
|