forked from ChrisMayfield/ThinkJavaCode2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMathMethods.java
More file actions
23 lines (16 loc) · 594 Bytes
/
MathMethods.java
File metadata and controls
23 lines (16 loc) · 594 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
public class MathMethods {
public static void main(String[] args) {
double root = Math.sqrt(17.0);
double angle = 1.5;
double height = Math.sin(angle);
double degrees = 90;
double angle2 = degrees / 180.0 * Math.PI;
double radians = Math.toRadians(180.0);
double degrees2 = Math.toDegrees(Math.PI);
long x = Math.round(Math.PI * 20.0);
// examples of composition
double x2 = Math.cos(angle + Math.PI / 2.0);
double x3 = Math.exp(Math.log(10.0));
double x4 = Math.pow(2.0, 10.0);
}
}