forked from AllenDowney/ThinkJavaCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMethods.java
More file actions
22 lines (18 loc) · 588 Bytes
/
Methods.java
File metadata and controls
22 lines (18 loc) · 588 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/**
* Examples from Chapter 4.
*/
public class Methods {
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);
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);
}
}