-
Notifications
You must be signed in to change notification settings - Fork 6
/
grid_winds.js
98 lines (91 loc) · 2.06 KB
/
grid_winds.js
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
var windJson = {
"type": "FeatureCollection",
"features": []
}
//From https://sailwind.fandom.com/wiki/Trade_winds
let skip = false;
for (let long = minLong+0.5; long <= maxLong; long++) {
for (let lat = minLat+0.5; lat <= maxLat; lat++) {
if(lat > 33){
let deltax = Math.sin(1.106539)*0.15;
let deltay = Math.cos(1.106539)*0.15;
windJson.features.push({
"type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": [[long-deltax, lat-deltay], [long+deltax, lat+deltay]]
},
"properties":{
"Region": "Aestrin"
}
});
}
else if(long < -2){
let deltax = Math.sin(0.78539)*0.15;
let deltay = Math.cos(0.78539)*0.15;
windJson.features.push({
"type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": [[long-deltax, lat-deltay], [long+deltax, lat+deltay]]
},
"properties":{
"Region": "Al'Ankh"
}
});
}
else if(lat < 32){
let deltax = Math.sin(4.2481314)*0.15;
let deltay = Math.cos(4.2481314)*0.15;
windJson.features.push({
"type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": [[long-deltax, lat-deltay], [long+deltax, lat+deltay]]
},
"properties":{
"Region": "Emerald"
}
});
}
}
}
/* for (let i = minLong; i <= maxLong; i+=2) {
let opposite = Math.tan(1.106539) * (70-30);
windJson.features.push({
"type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": [[i, 33], [i+opposite, 70]]
},
"properties":{
"Region": "Aestrin"
}
});
}
for (let i = minLat; i <= maxLat; i+=2) {
let opposite = Math.tan(-0.78539) * 58;
windJson.features.push({
"type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": [[-2, i], [-60, i+opposite]]
},
"properties":{
"Region": "Al'Ankh"
}
});
}
for (let i = minLong; i <= maxLong; i+=2) {
let opposite = Math.tan(4.2481314) * 32;
windJson.features.push({
"type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": [[i, 32], [i-opposite, 0]]
},
"properties":{
"Region": "Emerald"
}
});
} */