-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdata.go
More file actions
39 lines (29 loc) · 1.2 KB
/
Copy pathdata.go
File metadata and controls
39 lines (29 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package maidenhead
const (
latSouthPole = 90.0
lngEastwardGreenwich = 180.0
lngFieldWidth = 20.0
lngSquareWidth = 2.0
lngSubSquareWidth = 1 / 12.0
lngExtendedSquareWidth = 1 / 120.0
lngSubExtendedSquareWidth = 1 / 2880.0
latFieldWidth = lngFieldWidth / 2
latSquareWidth = lngSquareWidth / 2
latSubSquareWidth = lngSubSquareWidth / 2
latExtendedSquareWidth = lngExtendedSquareWidth / 2
latSubExtendedSquareWidth = lngSubExtendedSquareWidth / 2
maxSteps = 5
FieldPrecision = 2
SquarePrecision = 4
SubSquarePrecision = 6
ExtendedSquarePrecision = 8
SubExtendedSquarePrecision = 10
alphabetSize = 24
)
var latDivider = [5]float64{latFieldWidth, latSquareWidth, latSubSquareWidth, latExtendedSquareWidth, latSubExtendedSquareWidth}
var lngDivider = [5]float64{lngFieldWidth, lngSquareWidth, lngSubSquareWidth, lngExtendedSquareWidth, lngSubExtendedSquareWidth}
var alphabet = [alphabetSize]byte{
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
}
var digits = [10]byte{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}