The
plumb bob
always hangs straight down from the center of the
PlumbView
.
Since we can’t tilt the emulators,
I took this screenshot on on my
Azpen
A727
tablet (a pathetic 800 × 480 pixels).
In Trigonometry, angles start at 3 o’clock and go counterclockwise.
Thus
3 o’clock is 0° (to the right)
2 o’clock is 30°
1 o’clock is 60°
12 o’clock is 90° (straight up)
etc.
tan 60° =
√3
≈ 8.580819/4.903325
In other words,
arctan 60° ≈ 8.580819/4.903325
The plumb bob hangs in exactly the
opposite
direction, 7 o’clock.
MainActivity.java
.
PlumbView.java
.
activity_main.xml
:
unused and ignored.
strings.xml
.
AndroidManifest.xml
.
build.gradle
(Module: app).
PlumbView
marked off at 15° intervals.