horoscope 0.0.1 → 0.0.3a

Sign up to get free protection for your applications and to get access to all the features.
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - "1.9.3"
4
+
data/README.md CHANGED
@@ -1,13 +1,15 @@
1
1
  # Horoscope
2
2
 
3
- Calculate the accurate horoscope of a person using Vedic Horoscope technique given the birth time and birth place of the subject.
3
+ Calculate the accurate horoscope of a person using Vedic Horoscope technique given the birth time and birth place of the subject. The gem is available at https://rubygems.org/gems/horoscope
4
+
5
+ [![Code Climate](https://codeclimate.com/github/bragboy/horoscope.png)](https://codeclimate.com/github/bragboy/horoscope)
4
6
 
5
7
  ## Installation
6
8
 
7
9
  Add this line to your application's Gemfile:
8
10
 
9
11
  gem 'horoscope'
10
-
12
+
11
13
  And then execute:
12
14
 
13
15
  $ bundle
@@ -15,6 +17,15 @@ And then execute:
15
17
  Or install it yourself as:
16
18
 
17
19
  $ gem install horoscope
20
+
21
+ Then you can start using this by passing a Time object along with latitude and longitude
22
+
23
+ #To calculate Sachin Tendulkar's horoscope
24
+ h = Horoscope::Horo.new(
25
+ :datetime => Time.mktime(1973, 4, 24, 14, 25).getlocal("+05:30"),
26
+ :lat => 18.60, :lon => -72.50)
27
+ h.compute
28
+ => {"As"=>4, "Su"=>0, "Mo"=>8, "Ma"=>9, "Me"=>11, "Ju"=>9, "Ve"=>0, "Sa"=>1, "Ra"=>8, "Ke"=>2}
18
29
 
19
30
 
20
31
  ## Contributing
@@ -24,3 +35,8 @@ Or install it yourself as:
24
35
  3. Commit your changes (`git commit -am 'Add some feature'`)
25
36
  4. Push to the branch (`git push origin my-new-feature`)
26
37
  5. Create new Pull Request
38
+
39
+
40
+ ## Future Development
41
+
42
+ I am currently adding features to generate charts (both South and North Indian). Also show more data like Birth Star, Dasha Directions etc., Follow this page for more updates
data/Rakefile CHANGED
@@ -1 +1,6 @@
1
1
  require "bundler/gem_tasks"
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task default: :spec
data/horoscope.gemspec CHANGED
@@ -11,6 +11,7 @@ Gem::Specification.new do |gem|
11
11
  gem.description = %q{Calculate the horoscope of a person given the birth date and time}
12
12
  gem.summary = %q{Calculate the accurate horoscope of a person using Vedic Horoscope technique given the birth time and birth place of the subject.}
13
13
  gem.homepage = ""
14
+ gem.add_development_dependency "rspec"
14
15
 
15
16
  gem.files = `git ls-files`.split($/)
16
17
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
data/lib/horoscope.rb CHANGED
@@ -1,7 +1,71 @@
1
- require "horoscope/version"
1
+ require 'horoscope/version'
2
+ require 'horoscope/overrides/math_override'
3
+ require 'horoscope/planet'
2
4
 
3
5
  module Horoscope
4
- def self.predict
5
- "Under construction"
6
+ class Horo
7
+
8
+ PLANETS = ["As", "Su", "Mo", "Ma", "Me", "Ju", "Ve", "Sa", "Ra", "Ke"]
9
+
10
+ ERRORS = {
11
+ :Date => "Error: Invalid Date. Enter a valid date between years 1600 AD and 2300 AD",
12
+ :Lat => "Error: Invalid Latitude. Enter between -90.0 to +90.0",
13
+ :Lon => "Error: Invalid Longitude. Enter between -180.0 to +180.0"
14
+ }
15
+
16
+ attr_accessor :datetime, :lat, :lon, :errors, :positions
17
+
18
+ def initialize(data={})
19
+ @data = data
20
+
21
+ @errors = []
22
+
23
+ @datetime = data[:datetime]
24
+ @zone = data[:offset]
25
+ @lat = data[:lat]
26
+ @lon = data[:lon]
27
+ @positions = Hash[PLANETS.map {|x| [x, nil]}]
28
+ end
29
+
30
+ def compute
31
+ return @errors if validate_values.size > 0
32
+
33
+ tpos = [10980, 16233, 15880, 16451, 15210, 13722, 13862, 7676, 4306, 15106]
34
+ tsp, pos, spd = [Array.new(10, 0), Array.new(10, 0), Array.new(10, 0)]
35
+ jd = Planet.get_jul_day(@datetime.month, @datetime.day, @datetime.year)
36
+ time = @datetime.hour + (@datetime.min / 60.0)
37
+ time -= @datetime.utc_offset / 3600.0
38
+ jd += time / 24.0
39
+ t = (jd - 0.5 - Planet::J2000) / 36525.0
40
+ Planet.get_planets(t, pos, spd)
41
+ pos[0] = Planet.ascendant(t, time, @lon, @lat)
42
+ ayn = Planet.get_ayan(t)
43
+ (0..9).each do |i|
44
+ tpos[i] = ((pos[i] + ayn) % 360.0 * 60.0).to_i
45
+ if tpos[i] < 0
46
+ tpos = tpos
47
+ n = i
48
+ tpos[n] += 21600
49
+ end
50
+ tsp[i] = (spd[i] * 3600.0).to_i
51
+ end
52
+ (0..11).each do |i|
53
+ (0..9).each do |j|
54
+ @positions[PLANETS[j]] = i if (tpos[j] / 1800 == i)
55
+ end
56
+ end
57
+ return @positions
58
+ end
59
+
60
+ private
61
+
62
+ def validate_values
63
+ @errors = []
64
+ @errors << ERRORS[:Date] if @datetime.nil? || !@datetime.is_a?(Time) || @datetime.year > 2300 || @datetime.year < 1600
65
+ @errors << ERRORS[:Lat] if @lat.nil? || @lat > 90.0 || @lat < -90.0
66
+ @errors << ERRORS[:Lon] if @lon.nil? || @lon > 180.0 || @lon < -180.0
67
+ @errors
68
+ end
69
+
6
70
  end
7
71
  end
@@ -0,0 +1,36 @@
1
+ # Equivalent Java methods overriden for Ruby
2
+ module Math
3
+ def self.IEEEremainder(x, y)
4
+ begin
5
+ regularMod = Math.java_mod(x,y) #DO NOT use Ruby Mod operator here as -1%13 yields different results for Java and Ruby
6
+ return 0.0 if (regularMod == 0)
7
+ alternativeResult = regularMod - (y.abs * Math.signum(x))
8
+ if alternativeResult.abs == regularMod.abs
9
+ divisionResult = x/y
10
+ roundedResult = divisionResult.round
11
+ return roundedResult.abs > divisionResult.abs ? alternativeResult : regularMod
12
+ end
13
+ return alternativeResult.abs < regularMod.abs ? alternativeResult : regularMod
14
+ rescue ZeroDivisionError
15
+ return 0.0/0.0 #NaN
16
+ end
17
+ end
18
+
19
+ def self.toRadians(angdeg)
20
+ angdeg / 180.0 * Math::PI
21
+ end
22
+
23
+ def self.toDegrees(angrad)
24
+ angrad * 180.0 / Math::PI
25
+ end
26
+
27
+ def self.signum(num)
28
+ num > 0 ? 1 : (num == 0? 0 : -1)
29
+ end
30
+
31
+ def self.java_mod(x,y)
32
+ return 0 if x == 0 && y != 0
33
+ return x%y if (x > 0 && y > 0) || (x<0 && y<0)
34
+ return x%y - y
35
+ end
36
+ end
@@ -0,0 +1,243 @@
1
+ require 'horoscope/planets/earth'
2
+ require 'horoscope/planets/jupiter'
3
+ require 'horoscope/planets/mars'
4
+ require 'horoscope/planets/mercury'
5
+ require 'horoscope/planets/moon'
6
+ require 'horoscope/planets/nod'
7
+ require 'horoscope/planets/saturn'
8
+ require 'horoscope/planets/venus'
9
+
10
+ module Planet
11
+ J2000 = 2451545.0
12
+ ASC, SUN, MON, MAR, MER, JUP, VEN, SAT, RAH, KET = [0,1,2,3,4,5,6,7,8,9]
13
+
14
+ def self.get_jul_day(month, day, year)
15
+ im = 12 * (year + 4800) + month - 3
16
+ july_day = (2 * (im % 12) + 7 + 365 * im) / 12
17
+ july_day += day + im / 48 - 32083;
18
+ july_day += (im / 4800 - im / 1200 + 38) if july_day > 2299171
19
+ july_day
20
+ end
21
+
22
+ def self.get_terms(pp, num, t)
23
+ v = 0.0
24
+ (0..(num/3-1)).each do |i|
25
+ a = pp[i * 3] * 1.0E-8
26
+ b = pp[i * 3 + 1] * 1.0E-8
27
+ c = pp[i * 3 + 2] * 0.001
28
+ v += a * Math.cos(b + c * t)
29
+ end
30
+ v
31
+ end
32
+
33
+ def self.get_planet(t, pol, lrg, tlist, tnum)
34
+ u = t/10.0
35
+ (0..2).each do |i|
36
+ tmp = 0.0
37
+ pwr = 1.0
38
+ (0..2).each do |j|
39
+ tp = tlist[i*3 + j]
40
+ n = tnum[i*3 + j]
41
+ x = 0.0
42
+ pwr *= u unless j == 0
43
+ unless tp.empty?
44
+ x = get_terms(tp, n, u)
45
+ x += lrg[i * 3 + j]
46
+ x *= pwr
47
+ end
48
+ tmp += x
49
+ end
50
+ pol[i] = tmp
51
+ end
52
+ end
53
+
54
+ def self.hel2geo(pol, spol)
55
+ l = pol[0]
56
+ b = pol[1]
57
+ r = pol[2]
58
+ sunL = spol[0]
59
+ sunB = spol[1]
60
+ sunR = spol[2]
61
+ x = r * Math.cos(b) * Math.cos(l) - sunR * Math.cos(sunB) * Math.cos(sunL)
62
+ y = r * Math.cos(b) * Math.sin(l) - sunR * Math.cos(sunB) * Math.sin(sunL)
63
+ lon = Math.atan2(y, x)
64
+ lon += 6.283185307179586 if lon < 0.0
65
+ lon
66
+ end
67
+
68
+ def self.get_lunar(t)
69
+ t2 = t * t;
70
+ l = 218.31665436 + 481267.8813424 * t - 0.0013268 * t2 + 1.856E-6 * (t * t2)
71
+ d = 297.8502042 + 445267.11151675 * t - 0.00163 * t + 1.832E-6 * (t * t2)
72
+ m = 357.52910918 + 35999.05029094 * t - 1.536E-4 * t2 + 4.1E-8 * (t * t2)
73
+ mm = 134.96341138 + 477198.86763133 * t + 0.008997 * t2 + 1.4348E-5 * (t * t2)
74
+ f = 93.2720993 + 483202.0175273 * t - 0.0034029 * t2 - 2.84E-7 * (t * t2)
75
+ e = 1.0 - 0.002516 * t - 7.4E-6 * t2
76
+ p = 0.0
77
+ (0..(Planets::Moon::NLUNTERMS-1)).each do |i|
78
+ term = Planets::Moon::TRG[i * 4] * d
79
+ term += Planets::Moon::TRG[i * 4 + 1] * m
80
+ term += Planets::Moon::TRG[i * 4 + 2] * mm
81
+ term += Planets::Moon::TRG[i * 4 + 3] * f
82
+ x = (Planets::Moon::TRG[i * 4 + 1]).abs
83
+ y = Planets::Moon::TRM[i] * 1.0E-8
84
+ unless x == 0
85
+ e_temp = e
86
+ e_temp = e * e if x == 2
87
+ p += y * e_temp * Math.sin(Math.toRadians(term))
88
+ else
89
+ p += y * Math.sin(Math.toRadians(term))
90
+ end
91
+ end
92
+ a1 = 119.75 + 131.849 * t
93
+ a2 = 53.09 + 479264.29 * t
94
+ p += 0.003958 * Math.sin(Math.toRadians(a1)) + 0.001926 * Math.sin(Math.toRadians(l - f)) + 3.18E-4 * Math.sin(Math.toRadians(a2))
95
+ l += p
96
+ l %= 360.0
97
+ end
98
+
99
+ def self.get_node(t, mean)
100
+ lon = 0.0;
101
+ n = 125.0446 - 1934.13618 * t + 0.0020762 * (t * t) + 2.139E-6 * (t * t * t)
102
+ n += 1.65E-8 * (t * t * t * t)
103
+ (0..21).each do |i|
104
+ x = Planets::Nod::TERMS[i * 5 + 1] * 1.0E-4
105
+ x += Planets::Nod::LRG[i] * t
106
+ x += Planets::Nod::TERMS[i * 5 + 2] * 1.0E-7 * t * t
107
+ x += Planets::Nod::TERMS[i * 5 + 3] * 1.0E-9 * t * t * t
108
+ x += Planets::Nod::TERMS[i * 5 + 4] * 1.0E-11 * t * t * t * t
109
+ lon += Planets::Nod::TERMS[i * 5] * 1.0E-4 * Math.sin(Math.toRadians(x))
110
+ end
111
+ phi = 125.0 - 1934.1 * t
112
+ sm = 25.9 * Math.sin(Math.toRadians(phi))
113
+ phi = 220.2 - 1935.5 * t
114
+ sm += -4.3 * Math.sin(Math.toRadians(phi))
115
+ ss = 0.38 * Math.sin(Math.toRadians(357.5 + 35999.1 * t))
116
+ sm = Math.toDegrees(sm + ss * t)
117
+ sm *= 1.0E-5
118
+ lon += sm
119
+ lon += n
120
+ lon %= 360.0
121
+ mn = n % 360.0
122
+ mean[0] = mn
123
+ lon
124
+ end
125
+
126
+ def self.get_ayan(t)
127
+ ayan = (5029.0 + 1.11 * t) * t + 85886.0
128
+ ayan /= 3600.0
129
+ -ayan
130
+ end
131
+
132
+ def self.ascendant(t, tod, lg, lt)
133
+ ra = (246.697374558 + 2400.0513 * t + tod) * 15.0 - lg
134
+ ra %= 360.0
135
+ ra = Math.toRadians(ra)
136
+ ob = 23.439291 - 0.0130042 * t - 1.639E-7 * t * t
137
+ ob = Math.toRadians(ob)
138
+ as = Math.atan2(Math.cos(ra), -Math.sin(ra) * Math.cos(ob) - Math.tan(Math.toRadians(lt)) * Math.sin(ob))
139
+ as += 3.141592653589793 if as < 0.0
140
+ as += 3.141592653589793 if Math.cos(ra) < 0.0
141
+ return Math.toDegrees(as)
142
+ end
143
+
144
+ def self.range(lon)
145
+ Math.toDegrees(lon) % 360.0
146
+ end
147
+
148
+ def self.planets(t, pos)
149
+ pol = [0.0, 0.0, 0.0]
150
+ spol = [0.0, 0.0, 0.0]
151
+ pos[ASC] = 0
152
+
153
+ get_planet(t, pol, Planets::Earth.lrg, Planets::Earth.ptr, Planets::Earth.terms)
154
+ spol[0] = pol[0]
155
+ spol[1] = pol[1]
156
+ spol[2] = pol[2]
157
+ lon = pol[0]
158
+ lon %= 6.283185307179586
159
+ u = t / 100.0
160
+ a1 = 2.18 - 3375.7 * u + 0.36 * u * u
161
+ a2 = 3.51 + 125666.39 * u + 0.1 * u * u
162
+ nu = 1.0E-7 * (-834.0 * Math.sin(a1) - 64.0 * Math.sin(a2))
163
+ ab = -993.0 + 17.0 * Math.cos(3.1 + 62830.14 * u)
164
+ ab *= 1.0E-7
165
+ lon += ab + nu
166
+ lon = range(lon) + 180.0;
167
+ lon -= 360.0 if lon > 360.0
168
+ pos[SUN] = lon
169
+ pos[MON] = get_lunar(t)
170
+
171
+ get_planet(t, pol, Planets::Mercury.lrg, Planets::Mercury.ptr, Planets::Mercury.terms)
172
+ lon = hel2geo(pol, spol)
173
+ ab = -1261.0 + 1485.0 * Math.cos(2.649 + 198048.273 * u)
174
+ ab += 305.0 * Math.cos(5.71 + 458927.03 * u)
175
+ ab += 230.0 * Math.cos(5.3 + 396096.55 * u)
176
+ ab *= 1.0E-7
177
+ lon += ab + nu
178
+ pos[MER] = range(lon);
179
+
180
+ get_planet(t, pol, Planets::Venus.lrg, Planets::Venus.ptr, Planets::Venus.terms)
181
+ lon = hel2geo(pol, spol)
182
+ ab = -1304.0 + 1016.0 * Math.cos(1.423 + 39302.097 * u)
183
+ ab += 224.0 * Math.cos(2.85 + 78604.19 * u)
184
+ ab += 98.0 * Math.cos(4.27 + 117906.29 * u)
185
+ ab *= 1.0E-7
186
+ lon += ab + nu
187
+ pos[VEN] = range(lon)
188
+
189
+ get_planet(t, pol, Planets::Mars.lrg, Planets::Mars.ptr, Planets::Mars.terms)
190
+ lon = hel2geo(pol, spol)
191
+ ab = -1052.0 + 877.0 * Math.cos(1.834 + 29424.634 * u)
192
+ ab += 187.0 * Math.cos(3.67 + 58849.27 * u)
193
+ ab += 84.0 * Math.cos(3.49 + 33405.34 * u)
194
+ ab *= 1.0E-7
195
+ lon += ab + nu
196
+ pos[MAR] = range(lon)
197
+
198
+ get_planet(t, pol, Planets::Jupiter.lrg, Planets::Jupiter.ptr, Planets::Jupiter.terms)
199
+ lon = hel2geo(pol, spol)
200
+ ab = -527.0 + 978.0 * Math.cos(1.154 + 57533.849 * u)
201
+ ab += 89.0 * Math.cos(2.3 + 115067.7 * u)
202
+ ab += 46.0 * Math.cos(4.64 + 62830.76 * u)
203
+ ab += 45.0 * Math.cos(0.76 + 52236.94 * u)
204
+ ab *= 1.0E-7
205
+ lon += ab
206
+ lon += nu
207
+ pos[JUP] = range(lon)
208
+
209
+ get_planet(t, pol, Planets::Saturn.lrg, Planets::Saturn.ptr, Planets::Saturn.terms)
210
+ lon = hel2geo(pol, spol)
211
+ ab = -373.0 + 986.0 * Math.cos(0.88 + 60697.768 * u)
212
+ ab += 54.0 * Math.cos(3.31 + 62830.76 * u)
213
+ ab += 52.0 * Math.cos(1.59 + 58564.78 * u)
214
+ ab += 51.0 * Math.cos(1.76 + 121395.54 * u)
215
+ ab *= 1.0E-7
216
+ lon += ab + nu
217
+ pos[SAT] = range(lon)
218
+
219
+ mnode = [0.0]
220
+ lon = get_node(t, mnode)
221
+ pos[RAH] = lon
222
+
223
+ lon += 180.0
224
+ lon -= 360.0 if lon > 360.0
225
+ pos[KET] = lon
226
+ end
227
+
228
+ def self.get_planets(t, pps, sps)
229
+ spd = Array.new(10, 0.0)
230
+ planets(t, pps)
231
+ hourbefore = t - 1.1407711613050422E-6
232
+ planets(hourbefore, spd)
233
+ (1..9).each do |i|
234
+ spd[i] = pps[i] - spd[i]
235
+ spd[i] -= 360.0 if spd[i] > 360.0
236
+ spd[i] *= 24.0
237
+ sps[i] = Math.java_mod(spd[i], 360.0)
238
+ sps[i] += 360.0 if sps[i] > 0.0
239
+ end
240
+ spd[2] += 360.0 if spd[2] < 0.0
241
+ end
242
+
243
+ end
@@ -0,0 +1,25 @@
1
+ module Planets
2
+ class Earth
3
+ L0 = [3341656, 466925680, 6283075, 34894, 462610241, 12566151, 3417, 282886579, 3523, 3497, 274411800, 5753384, 3135, 362767041, 77713771, 2676, 441808351, 7860419, 2342, 613516237, 3930209, 1273, 203709655, 529690, 1324, 74246356, 11506769, 901, 204505443, 26298, 1199, 110962944, 1577343, 857, 350849156, 398149, 779, 117882652, 5223693, 990, 523268129, 5884926, 753, 253339053, 5507553, 505, 458292563, 18849227, 492, 420506639, 775522, 356, 291954116, 67, 284, 189869034, 796298, 242, 34481140, 5486777, 317, 584901952, 11790629, 271, 31488607, 10977078, 206, 480646606, 2544314, 205, 186947813, 5573142, 202, 245767795, 6069776, 126, 108302630, 20775, 155, 83306073, 213299, 115, 64544911, 980, 102, 63599846, 4694002]
4
+ L1 = [206058, 267823455, 6283075, 4303, 263512650, 12566151, 425, 159046980, 3523, 108, 296618001, 1577343, 93, 259212835, 18849227, 119, 579557487, 26298, 72, 113846158, 529690, 67, 187472304, 398149, 67, 440918235, 5507553, 59, 288797038, 5223693, 55, 217471680, 155420, 45, 39803079, 796298, 36, 46624739, 775522, 28, 264707383, 7113]
5
+ L2 = [8719, 107209665, 6283075, 309, 86728818, 12566151, 27, 5297871, 3523, 16, 518826691, 26298, 15, 368457889, 155420, 9, 75742297, 18849227]
6
+ B0 = [279, 319870156, 84334661, 101, 542248619, 5507553, 80, 388013204, 5223693, 43, 370444689, 2352866, 31, 400026369, 1577343, 22, 398473831, 1047747, 16, 356456119, 5856477, 18, 498367470, 6283075, 14, 370275614, 9437762, 14, 341117857, 10213285, 11, 482820690, 14143495, 10, 208574562, 6812766, 9, 347303947, 4694002, 10, 405663927, 71092881, 8, 444016515, 5753384, 8, 499251512, 7084896, 6, 432559054, 6275962, 9, 114182646, 6620890, 7, 360193205, 529690, 7, 555425745, 167621575, 5, 248446991, 4705732, 5, 624992674, 18073704, 4, 233827747, 6309374, 5, 441023653, 7860419, 4, 70995680, 5884926, 4, 110255777, 6681224, 3, 182229412, 5486777, 4, 511700141, 13367972, 3, 43793170, 3154687]
7
+ B1 = [9, 389729061, 5507553, 6, 173038850, 5223693, 3, 524404145, 2352866, 2, 247345037, 1577343, 1, 41874743, 6283075, 1, 183320979, 5856477, 1, 569401926, 5753384, 1, 218890066, 9437762, 1, 495222451, 10213285, 1, 12866660, 7860419]
8
+ B2 = [1, 162703209, 84334661]
9
+ R0 = [100013988, 0, 0, 1670699, 309846350, 6283075, 13956, 305524609, 12566151, 3083, 519846674, 77713771, 1628, 117387749, 5753384, 1575, 284685245, 7860419, 924, 545292234, 11506769, 542, 456409149, 3930209, 472, 366100022, 5884926, 328, 589983646, 5223693, 345, 96368617, 5507553, 306, 29867139, 5573142, 174, 301193636, 18849227, 243, 427349536, 11790629, 211, 584714540, 1577343, 185, 502194447, 10977078, 109, 505510636, 5486777, 98, 88681311, 6069776, 86, 568959778, 15720838, 85, 127083733, 161000685, 62, 92177108, 529690, 57, 201374292, 83996847, 64, 27250613, 17260154, 49, 324501240, 2544314, 55, 524159798, 71430695, 42, 601110242, 6275962, 46, 257805070, 775522, 38, 536071738, 4694002, 44, 553715807, 9437762, 35, 167468058, 12036460]
10
+ R1 = [103018, 110748969, 6283075, 1721, 106442301, 12566151, 702, 314159265, 0, 32, 102169059, 18849227, 30, 284353804, 5507553, 24, 131906709, 5223693, 18, 142429748, 1577343, 10, 591378194, 10977078, 8, 27146150, 5486777, 8, 142046854, 6275962, 5, 168613426, 5088628, 4, 601401770, 6286598, 4, 598724494, 529690, 4, 51800238, 4694002, 3, 474969833, 2544314]
11
+ R2 = [4359, 578455133, 6283075, 123, 557934722, 12566151, 12, 314159265, 0, 8, 362777733, 77713771, 5, 186958905, 5573142, 3, 547027913, 18849227, 1, 448028885, 5507553]
12
+
13
+ def self.lrg
14
+ [1.75347, 6283.319667, 5.29E-4, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
15
+ end
16
+
17
+ def self.terms
18
+ [L0.size, L1.size, L2.size, B0.size, B1.size, B2.size, R0.size, R1.size, R2.size]
19
+ end
20
+
21
+ def self.ptr
22
+ [L0, L1, L2, B0, B1, B2, R0, R1, R2]
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,26 @@
1
+ module Planets
2
+ class Jupiter
3
+ L0 = [9695898, 506191793, 529690, 573610, 144406205, 7113, 306389, 541734729, 1059381, 97178, 414264708, 632783, 72903, 364042909, 522577, 64263, 341145185, 103092, 39806, 229376744, 419484, 38857, 127231724, 316391, 27964, 178454589, 536804, 13589, 577481031, 1589072, 8246, 358227961, 206185, 8768, 363000324, 949175, 7368, 508101125, 735876, 6263, 2497643, 213299, 6114, 451319531, 1162474, 4905, 132084631, 110206, 5305, 130671236, 14227, 5305, 418625053, 1052268, 4647, 469958109, 3932, 3045, 431675960, 426598, 2610, 156667594, 846082, 2028, 106376547, 3181, 1764, 214148077, 1066495, 1722, 388036008, 1265567, 1920, 97168928, 639897, 1633, 358201089, 515463, 1431, 429683690, 625670, 973, 409764957, 95979, 884, 243701426, 412371, 732, 608534113, 838969, 731, 380591233, 1581959, 691, 613368222, 2118763, 709, 129272573, 742990, 614, 410853496, 1478866, 495, 375567461, 323505, 581, 453967717, 309278, 375, 470299124, 1368660, 389, 489716105, 1692165, 341, 571452525, 533623, 330, 474049819, 48, 440, 295818460, 454909, 417, 103554430, 2447, 244, 522020878, 728762, 261, 187652461, 963, 256, 372410724, 199072, 261, 82047246, 380127, 220, 165115015, 543918, 201, 180684574, 1375773, 207, 185461666, 525758]
4
+ L1 = [489741, 422066689, 529690, 228918, 602647464, 7113, 27655, 457265956, 1059381, 20720, 545938936, 522577, 12105, 16985765, 536804, 6068, 442419502, 103092, 5433, 398478382, 419484, 4237, 589009351, 14227, 2211, 526771446, 206185, 1295, 555132765, 3181, 1745, 492669378, 1589072, 1163, 51450895, 3932, 1007, 46478398, 735876, 1173, 585647304, 1052268, 847, 575805850, 110206, 827, 480312015, 213299, 1003, 315040301, 426598, 1098, 530704981, 515463, 816, 58643054, 1066495, 725, 551827471, 639897, 567, 598867049, 625670, 474, 413245269, 412371, 412, 573652891, 95979, 335, 373248749, 1162474]
5
+ L2 = [30629, 293021440, 529690, 38965, 0, 0, 3189, 105504615, 522577, 2723, 341411526, 1059381, 2729, 484545481, 536804, 1721, 418734385, 14227, 383, 576790714, 419484, 367, 605509120, 103092, 377, 76048964, 515463]
6
+ B0 = [2268615, 355852606, 529690, 109971, 390809347, 1059381, 110090, 0, 0, 8101, 360509573, 522577, 6043, 425883108, 1589072, 6437, 30627121, 536804, 1106, 298534421, 1162474, 941, 293619072, 1052268, 894, 175447429, 7113, 767, 215473594, 632783, 944, 167522288, 426598, 684, 367808770, 213299, 629, 64343282, 1066495, 835, 517881973, 103092, 531, 270305954, 110206]
7
+ B1 = [177351, 570166488, 529690, 3230, 577941619, 1059381, 3081, 547464296, 522577, 2211, 473477480, 536804, 1694, 314159265, 0, 346, 474595174, 1052268, 234, 518856099, 1066495, 196, 618554286, 7113, 150, 392721226, 1589072, 114, 343897271, 632783]
8
+ B2 = [8094, 146322843, 529690, 742, 95691639, 522577, 813, 314159265, 0, 398, 289888666, 536804, 342, 144683789, 1059381]
9
+ R0 = [520887429, 0, 0, 25209327, 349108640, 529690, 610599, 384115365, 1059381, 282029, 257419879, 632783, 187647, 207590380, 522577, 86792, 71001090, 419484, 72062, 21465694, 536804, 65517, 597995850, 316391, 29134, 167759243, 103092, 30135, 216132058, 949175, 23453, 354023147, 735876, 22283, 419362773, 1589072, 23947, 27457854, 7113, 13032, 296043055, 1162474, 9703, 190669572, 206185, 12748, 271550102, 1052268, 9161, 441352618, 213299, 7894, 247907551, 426598, 7057, 218184753, 1265567, 6137, 626417542, 846082, 5477, 565729325, 639897, 3502, 56531297, 1066495, 4136, 272219979, 625670, 4170, 201605033, 515463, 2499, 455182055, 838969, 2616, 200993967, 1581959, 1911, 85621927, 412371, 2127, 612751461, 742990, 1610, 308867789, 1368660, 1479, 268026191, 1478866, 1230, 189042979, 323505, 1216, 180171561, 110206, 961, 454876989, 2118763, 885, 414785948, 533623, 776, 367696954, 728762, 998, 287208940, 309278, 1014, 138673237, 454909, 727, 398824686, 1155361, 655, 279065604, 1685052, 821, 159342534, 1898351]
10
+ R1 = [1271801, 264937511, 529690, 61661, 300076251, 1059381, 53443, 389717644, 522577, 31185, 488276663, 536804, 41390, 0, 0, 11847, 241329588, 419484, 9166, 475979408, 7113, 3175, 279297987, 103092, 3203, 521083285, 735876, 3403, 334688537, 1589072, 2600, 363435101, 206185, 2412, 146947308, 426598, 2806, 374223693, 515463, 2676, 433052878, 1052268, 2100, 392762682, 639897, 1646, 530953510, 1066495, 1641, 441628669, 625670, 1049, 316113622, 213299, 1024, 255432643, 412371, 740, 217094630, 1162474]
11
+ R2 = [79644, 135865896, 529690, 8251, 577773935, 522577, 7029, 327476965, 536804, 5314, 183835109, 1059381, 1860, 297682139, 7113, 836, 419889881, 419484, 964, 548031822, 515463, 406, 378250730, 1066495, 426, 222753101, 639897, 377, 224248352, 1589072]
12
+
13
+
14
+ def self.lrg
15
+ [0.599547, 529.934808, 4.72E-4, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
16
+ end
17
+
18
+ def self.terms
19
+ [L0.size, L1.size, L2.size, B0.size, B1.size, B2.size, R0.size, R1.size, R2.size]
20
+ end
21
+
22
+ def self.ptr
23
+ [L0, L1, L2, B0, B1, B2, R0, R1, R2]
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,25 @@
1
+ module Planets
2
+ class Mars
3
+ L0 = [18656368, 505037100, 3340612, 1108216, 540099836, 6681224, 91798, 575478745, 10021837, 27744, 597049512, 3523, 10610, 293958524, 2281230, 12315, 84956081, 2810921, 8926, 415697845, 17, 8715, 611005159, 13362449, 6797, 36462243, 398149, 7774, 333968655, 5621842, 3575, 166186540, 2544314, 4161, 22814975, 2942463, 3075, 85696597, 191448, 2628, 64806143, 3337089, 2937, 607893711, 67, 2389, 503896401, 796298, 2579, 2996706, 3344135, 1528, 114979306, 6151533, 1798, 65634026, 529690, 1264, 362275092, 5092151, 1286, 306795924, 2146165, 1546, 291579633, 1751539, 1024, 369334293, 8962455, 891, 18293899, 16703062, 858, 240093704, 2914014, 832, 246418591, 3340595, 832, 449495753, 3340629, 712, 366336014, 1059381, 748, 382248399, 155420, 723, 67497565, 3738761, 635, 292182704, 8432764, 655, 48864075, 3127313, 550, 381001205, 980, 552, 447478863, 1748016, 425, 55365138, 6283075, 415, 49662314, 213299, 472, 362547819, 1194447, 306, 38052862, 6684747, 312, 99853322, 6677701, 293, 422131277, 20775, 302, 448618150, 3532060, 274, 54222141, 3340545, 281, 588163372, 1349867, 231, 128240685, 3870303, 283, 576885494, 3149164, 236, 575504515, 3333498, 274, 13372501, 3340679, 299, 278323705, 6254626, 204, 282133266, 1221848]
4
+ L1 = [1458227, 360426053, 3340612, 164901, 392631250, 6681224, 19963, 426594061, 10021837, 3452, 473210386, 3523, 2485, 461277567, 13362449, 841, 445858256, 2281230, 537, 501589727, 398149, 521, 499422678, 3344135, 432, 256066402, 191448, 429, 531646162, 155420, 381, 353881289, 796298, 314, 496335266, 16703062, 282, 315967518, 2544314, 205, 456891455, 2146165, 168, 132894813, 3337089, 157, 418501035, 1751539, 133, 223325104, 980, 116, 221347652, 1059381, 117, 602407213, 6151533, 113, 542803224, 3738761, 133, 597421903, 1748016, 91, 109627836, 1349867, 83, 529636626, 6684747, 113, 212869455, 1194447]
5
+ L2 = [54187, 0, 0, 13908, 245742359, 6681224, 2465, 280000020, 10021837, 398, 314118428, 13362449, 222, 319436080, 3523, 120, 54325292, 155420, 61, 348529427, 16703062, 53, 354191121, 3344135, 34, 600188499, 2281230, 31, 414015171, 191448, 29, 199870679, 796298, 23, 433403365, 242728, 21, 344532466, 398149, 16, 611000472, 2146165]
6
+ B0 = [3197134, 376832042, 3340612, 298033, 410616996, 6681224, 289104, 0, 0, 31365, 444651052, 10021837, 3484, 478812547, 13362449, 442, 565233015, 3337089, 443, 502642620, 3344135, 399, 513056814, 16703062, 292, 379290644, 2281230, 181, 613648011, 6151533, 163, 426399626, 529690, 159, 223194610, 1059381, 139, 241796344, 8962455, 149, 216501209, 5621842, 142, 118215016, 3340595, 142, 321292180, 3340629, 82, 536667872, 6684747, 73, 509187524, 398149, 72, 553775710, 6283075, 86, 574429648, 3738761, 83, 598866315, 6677701, 60, 367960808, 796298]
7
+ B1 = [350068, 536847836, 3340612, 14116, 314159265, 0, 9670, 547877786, 6681224, 1471, 320205766, 10021837, 425, 340843812, 13362449, 102, 77617286, 3337089, 78, 371768293, 16703062, 26, 248293558, 2281230, 32, 345803723, 5621842, 20, 144120802, 6151533, 18, 603102943, 529690, 15, 393075566, 8962455, 16, 481115186, 3344135, 13, 97324736, 6677701]
8
+ B2 = [16726, 60221392, 3340612, 4986, 314159265, 0, 302, 555871276, 6681224, 25, 189662673, 13362449, 21, 91749968, 10021837, 11, 224240738, 3337089, 7, 224892866, 16703062]
9
+ R0 = [153033488, 0, 0, 14184953, 347971283, 3340612, 660776, 381783442, 6681224, 46179, 415595316, 10021837, 8109, 555958460, 2810921, 7485, 177238998, 5621842, 5523, 136436318, 2281230, 3825, 449407182, 13362449, 2306, 9081742, 2544314, 1999, 536059605, 3337089, 2484, 492545577, 2942463, 1960, 474249386, 3344135, 1167, 211261501, 5092151, 1102, 500908264, 398149, 899, 440790433, 529690, 992, 583862401, 6151533, 807, 210216647, 1059381, 797, 344839026, 796298, 740, 149906336, 2146165, 692, 213378814, 8962455, 633, 89353285, 3340595, 725, 124516913, 8432764, 633, 292430448, 3340629, 574, 82896196, 2914014, 526, 538292276, 3738761, 629, 128738135, 1751539, 472, 519850457, 3127313, 348, 483219198, 16703062, 283, 290692294, 3532060, 279, 525749247, 6283075, 233, 510546492, 5486777, 219, 558340248, 191448, 269, 376394728, 5884926, 208, 525476080, 3340545, 275, 290818883, 1748016, 275, 121767967, 6254626, 239, 203669896, 1194447, 223, 419861593, 3149164, 182, 508062683, 6684747, 186, 569871555, 6677701, 175, 595341786, 3870303, 178, 418423025, 3333498, 208, 484626442, 3340679, 228, 325529020, 6872673, 144, 21296012, 5088628, 163, 379889068, 4136910, 133, 153910106, 7903073, 141, 247790321, 4562460, 114, 431745088, 1349867, 118, 212178071, 1589072]
10
+ R1 = [1107433, 203250524, 3340612, 103175, 237071845, 6681224, 12877, 0, 0, 10815, 270888093, 10021837, 1194, 304702182, 13362449, 438, 288835072, 2281230, 395, 342324611, 3344135, 182, 158428644, 2544314, 135, 338507017, 16703062, 128, 62991220, 1059381, 127, 195389775, 796298, 118, 299761345, 2146165, 128, 604343360, 3337089, 87, 342052758, 398149, 83, 385574986, 3738761, 75, 445101839, 6151533, 71, 276442180, 529690, 66, 254892602, 1751539, 54, 67750943, 8962455, 51, 372585409, 6684747, 66, 440597549, 1748016, 47, 228527896, 2914014, 49, 572959428, 3340595, 49, 147717922, 3340629, 57, 54354327, 1194447]
11
+ R2 = [44242, 47930603, 3340612, 8138, 86998398, 6681224, 1274, 122594050, 10021837, 187, 157298991, 13362449, 40, 197080175, 3344135, 52, 314159265, 0, 26, 191665615, 16703062, 17, 443499505, 2281230, 11, 452510453, 3185192, 10, 539143469, 1059381, 9, 41870577, 796298, 9, 453579272, 2146165, 7, 314218509, 2544314, 7, 229300859, 6684747, 6, 526702580, 155420]
12
+
13
+ def self.lrg
14
+ [6.203477, 3340.856275, 5.8E-4, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
15
+ end
16
+
17
+ def self.terms
18
+ [L0.size, L1.size, L2.size, B0.size, B1.size, B2.size, R0.size, R1.size, R2.size]
19
+ end
20
+
21
+ def self.ptr
22
+ [L0, L1, L2, B0, B1, B2, R0, R1, R2]
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,25 @@
1
+ module Planets
2
+ class Mercury
3
+ L0 = [40989414, 148302034, 26087903, 5046294, 447785489, 52175806, 855346, 116520322, 78263709, 165590, 411969163, 104351612, 34561, 77930765, 130439515, 7583, 371348400, 156527418, 3559, 151202669, 1109378, 1726, 35832239, 182615321, 1803, 410333178, 5661332, 1364, 459918318, 27197281, 1589, 299510417, 25028521, 1017, 88031439, 31749235, 714, 154144865, 24978524, 643, 530266110, 21535949, 404, 328228847, 208703225, 352, 524156297, 20426571, 343, 576531885, 955599, 339, 586327765, 25558212, 451, 604989275, 51116424, 325, 133674334, 53285184, 259, 98732428, 4551953, 345, 279211901, 15874617, 272, 249451163, 529690, 234, 26672118, 11322664, 238, 11343953, 1059381, 264, 391705094, 57837138, 216, 65987207, 13521751, 183, 262878670, 27043502, 175, 453636829, 51066427, 181, 243413502, 25661304, 208, 209178234, 47623852, 172, 245200164, 24498830, 142, 336003948, 37410567, 137, 29098447, 10213285, 118, 278149786, 77204327, 96, 620398202, 234791128, 125, 372079804, 39609654, 86, 264219349, 51646115, 86, 195953042, 46514474, 88, 541338795, 26617594, 106, 420572116, 19804827, 89, 585243631, 41962520, 84, 433100364, 79373087, 69, 419446437, 19669, 63, 314700877, 7238675, 68, 63424819, 83925041, 69, 357201709, 25132303, 59, 274692752, 16983996, 64, 4762925, 33326578, 55, 405312663, 30639856, 54, 314331542, 27147285, 47, 549722099, 3881, 49, 398985863, 6770710, 56, 511920557, 73711755, 41, 564185159, 53131406, 51, 547786463, 50586733, 44, 122366857, 77154330, 41, 519309298, 6283075, 38, 243117327, 12566151]
4
+ L1 = [1126007, 621703970, 26087903, 303471, 305565472, 52175806, 80538, 610454743, 78263709, 21245, 283531934, 104351612, 5592, 582675673, 130439515, 1472, 251845458, 156527418, 352, 305238094, 1109378, 388, 548039225, 182615321, 93, 611791163, 27197281, 90, 45481, 24978524, 102, 214879173, 208703225, 51, 562107554, 5661332, 44, 457348500, 25028521, 28, 304195430, 51066427, 22, 86475371, 955599, 27, 509210138, 234791128, 20, 371509622, 20426571, 20, 51934047, 21535949, 17, 572663608, 4551953, 16, 135134428, 529690, 15, 179184360, 11322664, 15, 574263453, 19669, 13, 359426938, 24498830, 12, 269591798, 53285184, 12, 389530641, 3881, 12, 470537436, 1059381, 7, 417682324, 26617594, 7, 50426804, 46514474, 8, 392723313, 27043502]
5
+ L2 = [16903, 469072300, 26087903, 7396, 134735624, 52175806, 3018, 445643539, 78263709, 1107, 126226537, 104351612, 378, 431998055, 130439515, 122, 106868541, 156527418, 38, 408011610, 182615321, 14, 463343085, 1109378, 11, 79187646, 208703225, 5, 471799772, 24978524, 3, 377317513, 234791128, 2, 144059109, 27197281, 2, 149570544, 51066427, 1, 46023695, 260879031]
6
+ B0 = [11737528, 198357498, 26087903, 2388076, 503738959, 52175806, 1222839, 314159265, 0, 543251, 179644363, 78263709, 129778, 483232503, 104351612, 31866, 158088495, 130439515, 7963, 460972126, 156527418, 2014, 135324164, 182615321, 513, 437835409, 208703225, 207, 491772563, 27197281, 208, 202020294, 24978524, 132, 111908492, 234791128, 100, 565684734, 20426571, 121, 181271752, 53285184, 91, 228163128, 25028521, 99, 9391887, 51116424, 94, 124184909, 31749235, 78, 440725880, 57837138, 77, 52557061, 1059381, 84, 508510388, 51066427, 49, 349752993, 5661332, 46, 323739270, 77204327, 44, 487849816, 79373087, 40, 246558332, 46514474, 37, 445768797, 4551953, 34, 414209210, 260879031, 35, 109057317, 1109378, 31, 118516389, 83925041, 30, 350328027, 21535949, 31, 241474588, 47623852]
7
+ B1 = [429151, 350169780, 26087903, 146233, 314159265, 0, 22675, 1515366, 52175806, 10894, 48540174, 78263709, 6353, 342943919, 104351612, 2495, 16051210, 130439515, 859, 318452433, 156527418, 277, 621020774, 182615321, 86, 295244391, 208703225, 26, 597708962, 234791128, 27, 29068938, 27197281, 12, 337744320, 53285184, 12, 53792661, 24978524, 7, 271768609, 260879031, 7, 358305121, 51066427, 6, 292383205, 31749235, 5, 197318763, 51116424, 3, 34761695, 77154330, 3, 10739761, 79373087]
8
+ B2 = [11830, 479065585, 26087903, 1913, 0, 0, 1044, 121216540, 52175806, 266, 443418336, 78263709, 170, 162255638, 104351612, 96, 480023691, 130439515, 44, 160758267, 156527418, 18, 466904655, 182615321, 6, 143404888, 208703225, 2, 447495202, 234791128]
9
+ R0 = [39528271, 0, 0, 7834131, 619233722, 26087903, 795525, 295989690, 52175806, 121281, 601064153, 78263709, 21921, 277820093, 104351612, 4354, 582894543, 130439515, 918, 259650562, 156527418, 260, 302817753, 27197281, 289, 142441936, 25028521, 201, 564725040, 182615321, 201, 559227724, 31749235, 141, 625264202, 24978524, 100, 373435608, 21535949, 77, 366972526, 20426571, 63, 429905918, 25558212, 62, 476588899, 1059381, 66, 252520309, 5661332, 75, 447428642, 51116424, 48, 606824478, 53285184, 45, 241480951, 208703225, 35, 105917802, 27043502, 40, 235882016, 57837138, 44, 121957314, 15874617, 33, 86381554, 25661304, 37, 51733821, 47623852, 30, 179500530, 37410567, 28, 302063625, 51066427, 30, 88366335, 24498830, 26, 215021963, 39609654, 18, 496496008, 11322664, 21, 536857139, 13521751, 19, 498378647, 10213285, 16, 388765393, 26617594, 15, 44510589, 46514474, 17, 124077764, 77204327, 13, 162573946, 27147285, 13, 107657890, 51646115, 15, 428173463, 41962520, 13, 477056848, 33326578, 12, 606437138, 1109378, 13, 199984876, 25132303, 16, 263293587, 19804827, 11, 236500939, 4551953, 10, 546555460, 234791128, 12, 207613721, 529690, 12, 284997619, 79373087, 9, 121263611, 14765239, 9, 83697007, 12566151, 9, 541195286, 83925041, 7, 244636811, 30639856, 7, 553233943, 32858613, 7, 117101960, 16983996, 8, 356622930, 73711755, 7, 532625264, 426598, 6, 182313992, 36301188, 6, 427818149, 43071899, 8, 387737694, 50586733, 6, 531108526, 1589072, 5, 406893157, 53131406, 7, 391505031, 51749208]
10
+ R1 = [217347, 465617158, 26087903, 44141, 142385543, 52175806, 10094, 447466326, 78263709, 2432, 124226083, 104351612, 1624, 0, 0, 603, 429303116, 130439515, 152, 106060779, 156527418, 39, 411136751, 182615321, 17, 454424652, 27197281, 17, 471193725, 24978524, 10, 87893548, 208703225, 8, 300540854, 25028521, 4, 213639058, 20426571, 4, 148074475, 51066427, 3, 321171223, 1059381, 3, 523846336, 21535949, 2, 392968881, 234791128, 2, 202623950, 24498830, 2, 123911360, 53285184, 1, 404524902, 5661332, 1, 261849590, 26617594, 1, 235659537, 27043502, 1, 137876323, 1109378, 1, 519094850, 46514474, 1, 21246226, 11322664, 1, 623733263, 27147285, 1, 56437938, 25132303, 1, 86374628, 57837138, 1, 328272284, 37410567, 1, 453194022, 77154330]
11
+ R2 = [3117, 308231840, 26087903, 1245, 615183317, 52175806, 424, 292583352, 78263709, 136, 597983925, 104351612, 42, 274936980, 130439515, 21, 314159265, 0, 12, 580143162, 156527418, 3, 256993599, 182615321, 1, 314648120, 24978524, 1, 562142196, 208703225]
12
+
13
+ def self.lrg
14
+ [4.402507, 26088.147062, 5.3E-4, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
15
+ end
16
+
17
+ def self.terms
18
+ [L0.size, L1.size, L2.size, B0.size, B1.size, B2.size, R0.size, R1.size, R2.size]
19
+ end
20
+
21
+ def self.ptr
22
+ [L0, L1, L2, B0, B1, B2, R0, R1, R2]
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,7 @@
1
+ module Planets
2
+ class Moon
3
+ NLUNTERMS = 60
4
+ TRM = [628877383, 127401064, 65830943, 21361825, -18511586, -11433213, 5879321, 5706551, 5332117, 4575792, -4092258, -3471892, -3038341, 1532696, -1252767, 1098147, 1067495, 1003439, 854794, -788808, -676617, -516242, 498735, 403619, 399436, 386085, 366502, -268863, -260163, 239042, -234807, 223616, -211949, -206874, 204755, -177310, -159489, 121500, -111045, -89158, -80959, 75886, -71332, -70033, 69136, 59613, 54937, 53713, 51966, -48694, -39921, -38127, 35051, -34003, 32968, 32694, -32269, 29935, 29431, -27506]
5
+ TRG = [0, 0, 1, 0, 2, 0, -1, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 1, 0, 0, 0, 0, 0, 2, 2, 0, -2, 0, 2, -1, -1, 0, 2, 0, 1, 0, 2, -1, 0, 0, 0, 1, -1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 2, 0, 0, -2, 0, 0, 1, 2, 0, 0, 1, -2, 4, 0, -1, 0, 0, 0, 3, 0, 4, 0, -2, 0, 2, 1, -1, 0, 2, 1, 0, 0, 1, 0, -1, 0, 1, 1, 0, 0, 2, -1, 1, 0, 2, 0, 2, 0, 4, 0, 0, 0, 2, 0, -3, 0, 0, 1, -2, 0, 2, 0, -1, 2, 2, -1, -2, 0, 1, 0, 1, 0, 2, -2, 0, 0, 0, 1, 2, 0, 0, 2, 0, 0, 2, -2, -1, 0, 2, 0, 1, -2, 2, 0, 0, 2, 4, -1, -1, 0, 0, 0, 2, 2, 3, 0, -1, 0, 2, 1, 1, 0, 4, -1, -2, 0, 0, 2, -1, 0, 2, 2, -1, 0, 2, 1, -2, 0, 2, -1, 0, -2, 4, 0, 1, 0, 0, 0, 4, 0, 4, -1, 0, 0, 1, 0, -2, 0, 2, 1, 0, -2, 0, 0, 2, -2, 1, 1, 1, 0, 3, 0, -2, 0, 4, 0, -3, 0, 2, -1, 2, 0, 0, 2, 1, 0, 1, 1, -1, 0, 2, 0, 3, 0, 2, 0, 1, 2]
6
+ end
7
+ end
@@ -0,0 +1,6 @@
1
+ module Planets
2
+ class Nod
3
+ TERMS = [-14979, 491562, 35458, 4231, -2001, -1500, 3575291, -1536, 41, 0, -1226, 2357004, -32601, 3664, -1769, 1176, 1865442, -68058, -567, 232, -801, 833826, 247999, 29262, -13826, -616, 516271, 36994, 4190, -2001, 490, 1007370, -122571, 10684, 5028, 409, 3084192, 158029, 14915, -7029, 327, 1349634, 89970, 14348, -6797, 324, 466853, 33922, 4272, -2001, 196, 983124, 70916, 8462, -4001, 180, 2741928, -54513, -10116, 4797, 150, 3257736, -212541, -25031, 11826, -150, 1841196, 125428, 18579, -8798, -78, 2381713, -31065, 3623, -1769, -45, 106638, 57370, 18011, -8566, 44, 3215076, 21912, 13780, -6565, -42, 1628868, -106271, -12516, 5913, -31, 1709849, 66523, 608, -232, 31, 1032079, -121035, -10724, 5028, 28, 2226120, 103516, 4798, -2232, 28, 1840733, -69594, -526, 232]
4
+ LRG = [-75869.812, 35999.0503, 890534.223, 966404.0351, -12006.2998, -111868.8623, 413335.3554, -489205.1674, 477198.8676, -39870.7617, -151739.624, -553068.6797, -63863.5122, 401329.0556, 854535.1727, 1367733.0907, 1443602.9027, -31931.7561, -930404.9848, 377336.3051, -1042273.8471, 1002403.0853]
5
+ end
6
+ end
@@ -0,0 +1,25 @@
1
+ module Planets
2
+ class Saturn
3
+ L0 = [11107659, 396205090, 213299, 1414150, 458581515, 7113, 398379, 52112025, 206185, 350769, 330329903, 426598, 206816, 24658366, 103092, 79271, 384007078, 220412, 23990, 466976934, 110206, 16573, 43719123, 419484, 14906, 576903283, 316391, 15820, 93808953, 632783, 14609, 156518573, 3932, 13160, 444891180, 14227, 15053, 271670027, 639897, 13005, 598119067, 11045, 10725, 312939596, 202253, 5863, 23657028, 529690, 5227, 420783162, 3181, 6126, 176328499, 277034, 5019, 317787919, 433711, 4592, 61976424, 199072, 4005, 224479893, 63735, 2953, 98280385, 95979, 3873, 322282692, 138517, 2461, 203163631, 735876, 3269, 77491895, 949175, 1758, 326580514, 522577, 1640, 550504966, 846082, 1391, 402331978, 323505, 1580, 437266314, 309278, 1123, 283726793, 415552, 1017, 371698151, 227526, 848, 319149825, 209366, 1087, 418343232, 2447, 956, 50740889, 1265567, 789, 500745123, 963, 686, 174714407, 1052268, 654, 159889331, 48, 748, 214398149, 853196, 633, 229889902, 412371, 743, 525276954, 224344, 852, 342141350, 175166, 579, 309259007, 74781, 624, 97046831, 210117, 529, 444938897, 117319, 542, 151824320, 9561, 474, 547527185, 742990, 448, 128990416, 127471, 546, 212678554, 350332, 478, 296488054, 137033]
4
+ L1 = [1296855, 182820544, 213299, 564347, 288500136, 7113, 98323, 108070061, 426598, 107678, 227769911, 206185, 40254, 204128257, 220412, 19941, 127954662, 103092, 10511, 274880392, 14227, 6939, 40493079, 639897, 4803, 244194097, 419484, 4056, 292166618, 110206, 3768, 364965631, 3932, 3384, 241694251, 3181, 3302, 126256486, 433711, 3071, 232739317, 199072, 1953, 356394683, 11045, 1249, 262803737, 95979, 921, 196089834, 227526, 705, 441689249, 529690, 649, 617418093, 202253, 627, 611088227, 309278, 486, 603998200, 853196, 468, 461707843, 63735, 478, 498776987, 522577, 417, 211708169, 323505, 407, 129949556, 209366, 343, 395854178, 412371, 339, 363396398, 316391, 335, 377173072, 735876, 331, 286077699, 210117, 352, 231707079, 632783, 289, 273263080, 117319]
5
+ L2 = [91920, 7425261, 213299, 90592, 0, 0, 15276, 406492007, 206185, 10631, 25778277, 220412, 10604, 540963595, 426598, 4265, 104595556, 14227, 1215, 291860042, 103092, 1164, 460942128, 639897, 1081, 569130351, 433711, 1020, 63369182, 3181, 1044, 404206453, 199072, 633, 438825410, 419484, 549, 557303134, 3932, 456, 126840971, 110206, 425, 20935499, 227526]
6
+ B0 = [4330678, 360284428, 213299, 240348, 285238489, 426598, 84745, 0, 0, 30863, 348441504, 220412, 34116, 57297307, 206185, 14734, 211846597, 639897, 9916, 579003189, 419484, 6993, 473604689, 7113, 4807, 543305315, 316391, 4788, 496512927, 110206, 3432, 273255752, 433711, 1506, 601304536, 103092, 1060, 563099292, 529690, 969, 520434966, 632783, 942, 139646678, 853196, 707, 380302329, 323505, 552, 513149109, 202253, 399, 335891413, 227526, 316, 199716764, 647010, 319, 362571550, 209366, 284, 488648481, 224344, 314, 46510272, 217231, 236, 213887472, 11045, 215, 594982610, 846082, 208, 212003893, 415552]
7
+ B1 = [397554, 533289992, 213299, 49478, 314159265, 0, 18571, 609919206, 426598, 14800, 230586060, 206185, 9643, 169674660, 220412, 3757, 125429514, 419484, 2716, 591166664, 639897, 1455, 85161616, 433711, 1290, 291770857, 7113, 852, 43572078, 316391, 284, 161881754, 227526, 292, 531574251, 853196, 275, 388864137, 103092]
8
+ B2 = [20629, 50482422, 213299, 3719, 399833475, 206185, 1627, 618189939, 220412, 1346, 0, 0, 705, 303914308, 419484, 365, 509928680, 426598]
9
+ R0 = [955758135, 0, 0, 52921382, 239226219, 213299, 1873679, 523549605, 206185, 1464663, 164763045, 426598, 821891, 593520025, 316391, 547506, 501532628, 103092, 371684, 227114833, 220412, 361778, 313904303, 7113, 140617, 570406652, 632783, 108974, 329313595, 110206, 69007, 594099622, 419484, 61053, 94037761, 639897, 48913, 155733388, 202253, 34143, 19518550, 277034, 32401, 547084606, 949175, 20936, 46349163, 735876, 20839, 152102590, 433711, 20746, 533255667, 199072, 15298, 305943652, 529690, 14296, 260433537, 323505, 11993, 598051421, 846082, 11380, 173105746, 522577, 12884, 164892310, 138517, 7752, 585191318, 95979, 9796, 520475863, 1265567, 6465, 17733160, 1052268, 6770, 300433479, 14227, 5850, 145519636, 415552, 5307, 59737534, 63735, 4695, 214919036, 227526, 4043, 164010323, 209366, 3688, 78016133, 412371, 3376, 369528478, 224344, 2885, 138764077, 838969, 2976, 568467931, 210117, 3419, 494549148, 1581959, 3460, 185088802, 175166, 3400, 55386747, 350332, 2507, 353851863, 742990, 2448, 618412386, 1368660, 2406, 296559220, 117319, 2881, 17960757, 853196, 2173, 1508587, 340770, 2024, 505411271, 11045, 1740, 234657043, 309278, 1861, 593361638, 625670, 1888, 2968443, 3932, 1610, 117302463, 74781, 1462, 192588134, 216480, 1474, 567670461, 203737]
10
+ R1 = [6182981, 25843515, 213299, 506577, 71114650, 206185, 341394, 579635773, 426598, 188491, 47215719, 220412, 186261, 314159265, 0, 143891, 140744864, 7113, 49621, 601744469, 103092, 20928, 509245654, 639897, 19952, 117560125, 419484, 18839, 160819563, 110206, 12892, 594330258, 433711, 13876, 75886204, 199072, 5396, 128852405, 14227, 4869, 86793894, 323505, 4247, 39299384, 227526, 3252, 125853470, 95979, 2856, 216731405, 735876, 2909, 460679154, 202253, 3081, 343662557, 522577, 1987, 245054204, 412371, 1941, 602393385, 209366, 1581, 129191789, 210117, 1339, 430801821, 853196, 1315, 125296446, 117319, 1203, 186654673, 316391, 1091, 7527246, 216480, 954, 515173410, 647010, 966, 47991379, 632783, 881, 188471724, 1052268, 874, 140224683, 224344, 897, 98343776, 529690, 784, 306377517, 838969]
11
+ R2 = [436902, 478671673, 213299, 71922, 250069994, 206185, 49766, 497168150, 220412, 43220, 386940443, 426598, 29645, 596310264, 7113, 4141, 410670940, 433711, 4720, 247527992, 199072, 3789, 309771025, 639897, 2963, 137206248, 103092, 2556, 285065721, 419484, 2208, 627588858, 110206, 2187, 585545832, 14227, 1956, 492448618, 227526, 2326, 0, 0, 923, 546392422, 323505, 705, 297081280, 95979]
12
+
13
+ def self.lrg
14
+ [0.874014, 213.542956, 0.001164, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
15
+ end
16
+
17
+ def self.terms
18
+ [L0.size, L1.size, L2.size, B0.size, B1.size, B2.size, R0.size, R1.size, R2.size]
19
+ end
20
+
21
+ def self.ptr
22
+ [L0, L1, L2, B0, B1, B2, R0, R1, R2]
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,25 @@
1
+ module Planets
2
+ class Venus
3
+ L0 = [1353968, 559313319, 10213285, 89891, 530650048, 20426571, 5477, 441630652, 7860419, 3455, 269964470, 11790629, 2372, 299377539, 3930209, 1317, 518668219, 26298, 1664, 425018935, 1577343, 1438, 415745043, 9683594, 1200, 615357115, 30639856, 761, 195014702, 529690, 707, 106466707, 775522, 584, 399839884, 191448, 769, 81629615, 9437762, 499, 412340210, 15720838, 326, 459056472, 10404733, 429, 358642859, 19367189, 326, 567736583, 5507553, 231, 316251057, 9153903, 179, 465337915, 1109378, 128, 422604493, 20775, 155, 557043888, 19651048, 127, 96209822, 5661332, 105, 153721191, 801820, 85, 35589249, 3154687, 99, 83288185, 213299, 98, 539389655, 13367972, 82, 321596990, 18837498, 88, 388868860, 9999986, 71, 11145739, 11015106, 56, 424039855, 7113, 70, 67458813, 23581258, 50, 24531603, 11322664, 46, 531576465, 18073704, 44, 606282201, 40853142, 42, 532873337, 2352866]
4
+ L1 = [95707, 246424448, 10213285, 14444, 51624564, 20426571, 213, 179547929, 30639856, 151, 610635282, 1577343, 173, 265535879, 26298, 82, 570234133, 191448, 69, 268136034, 9437762, 52, 360013087, 775522, 38, 103379037, 529690, 29, 125056322, 5507553, 25, 610664792, 10404733, 17, 619369798, 1109378, 16, 264330452, 7113, 14, 545138233, 9153903, 12, 124464400, 40853142, 11, 497604495, 213299, 12, 188122199, 382896, 8, 95282732, 13367972, 7, 439476760, 10206171, 6, 228168808, 2352866, 6, 408056644, 3154687]
5
+ L2 = [3891, 34514360, 10213285, 1337, 202011285, 20426571, 23, 204592119, 26298, 19, 353527371, 30639856, 9, 397130221, 775522, 7, 151962593, 1577343]
6
+ B0 = [5923638, 26702775, 10213285, 40107, 114737178, 20426571, 32814, 314159265, 0, 1011, 108946123, 30639856, 149, 625390296, 18073704, 137, 86020146, 1577343, 129, 367152483, 9437762, 119, 370468812, 2352866, 107, 453903677, 22003914, 92, 153954562, 9153903, 52, 228138172, 5507553, 45, 72319641, 10239583, 38, 293437865, 10186987, 43, 614015776, 11790629, 41, 599126845, 19896880, 39, 386842095, 8635942, 39, 394960351, 529690, 33, 483194909, 14143495, 23, 290646621, 10988808, 23, 200770618, 13367972, 21, 269701424, 19651048]
7
+ B1 = [513347, 180364310, 10213285, 4380, 338615711, 20426571, 196, 253001197, 30639856, 199, 0, 0, 14, 227087044, 9437762, 12, 150735622, 18073704, 11, 560462450, 1577343, 10, 524224313, 2352866, 9, 607545631, 22003914, 7, 150257909, 11790629, 8, 29371105, 9153903, 7, 508081885, 10186987, 4, 387801635, 10239583]
8
+ B2 = [22377, 338509143, 10213285, 281, 0, 0, 173, 525563766, 20426571, 26, 387040891, 30639856, 1, 9768632, 10186987]
9
+ R0 = [72334820, 0, 0, 489824, 402151832, 10213285, 1658, 490206728, 20426571, 1632, 284548851, 7860419, 1378, 112846590, 11790629, 498, 258682187, 9683594, 373, 142314837, 3930209, 263, 552938185, 9437762, 237, 255135903, 15720838, 221, 201346776, 19367189, 119, 301975365, 10404733, 125, 272769833, 1577343, 76, 159577224, 9153903, 85, 398607953, 19651048, 74, 411957854, 5507553, 41, 164273363, 18837498, 42, 381864530, 13367972, 39, 539019422, 23581258, 29, 567739528, 5661332, 27, 572392407, 775522, 27, 482151812, 11015106, 31, 231806719, 9999986, 19, 496157560, 11322664, 19, 53189326, 27511467, 13, 375530870, 18073704, 12, 113381083, 10206171, 16, 56453834, 529690, 11, 509025877, 3154687, 11, 23432298, 7084896, 13, 524353197, 17298182, 13, 337207825, 13745346, 9, 307004895, 1109378, 10, 245024712, 10239583]
10
+ R1 = [34551, 89198710, 10213285, 234, 177224942, 20426571, 233, 314159265, 0, 23, 111274502, 9437762, 10, 459168210, 1577343, 9, 453540907, 10404733, 6, 597703999, 5507553, 4, 387683960, 9153903, 3, 566196924, 13367972, 2, 282413291, 10206171, 2, 205314419, 775522, 2, 255137285, 18837498, 1, 264808558, 30639856, 1, 187612936, 11015106, 1, 20613045, 11322664, 1, 79431893, 17298182, 1, 616555101, 10239583]
11
+ R2 = [1406, 506366395, 10213285, 15, 547321687, 20426571, 13, 0, 0, 1, 278883988, 9437762]
12
+
13
+ def self.lrg
14
+ [3.176147, 10213.529431, 5.41E-4, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
15
+ end
16
+
17
+ def self.terms
18
+ [L0.size, L1.size, L2.size, B0.size, B1.size, B2.size, R0.size, R1.size, R2.size]
19
+ end
20
+
21
+ def self.ptr
22
+ [L0, L1, L2, B0, B1, B2, R0, R1, R2]
23
+ end
24
+ end
25
+ end
@@ -1,3 +1,3 @@
1
1
  module Horoscope
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.3a"
3
3
  end
@@ -0,0 +1,53 @@
1
+ require 'spec_helper'
2
+
3
+ describe Horoscope do
4
+ it "should error out for blanks" do
5
+ h = Horoscope::Horo.new
6
+ expect(h.compute).to eql(["Error: Invalid Date. Enter a valid date between years 1600 AD and 2300 AD",
7
+ "Error: Invalid Latitude. Enter between -90.0 to +90.0",
8
+ "Error: Invalid Longitude. Enter between -180.0 to +180.0"])
9
+ end
10
+
11
+ it "should validate an universal horoscope" do
12
+ #Sachin Tendulkar's Birth Horoscope
13
+ h = Horoscope::Horo.new(:datetime => Time.mktime(1973, 4, 24, 14, 25).getlocal("+05:30"), :lat => 18.60, :lon => -72.50)
14
+ h.compute
15
+ expect(h.errors).to eql([])
16
+ expect(h.positions).to eql({"As"=>4, "Su"=>0, "Mo"=>8, "Ma"=>9, "Me"=>11, "Ju"=>9, "Ve"=>0, "Sa"=>1, "Ra"=>8, "Ke"=>2})
17
+ end
18
+
19
+ it "should validate all dates" do
20
+ h = Horoscope::Horo.new(:datetime => nil, :lat => 0, :lon => 0)
21
+ expect(h.compute).to eql(["Error: Invalid Date. Enter a valid date between years 1600 AD and 2300 AD"])
22
+
23
+ h.datetime = Time.mktime(1599)
24
+ expect(h.compute).to eql(["Error: Invalid Date. Enter a valid date between years 1600 AD and 2300 AD"])
25
+
26
+ h.datetime = Time.mktime(2301)
27
+ expect(h.compute).to eql(["Error: Invalid Date. Enter a valid date between years 1600 AD and 2300 AD"])
28
+
29
+ h.datetime = Time.mktime(2013)
30
+ h.compute
31
+ expect(h.errors).to eql([])
32
+ end
33
+
34
+ it "should validate lat and lon" do
35
+ h = Horoscope::Horo.new(:datetime => Time.now)
36
+ expect(h.compute).to eql(["Error: Invalid Latitude. Enter between -90.0 to +90.0",
37
+ "Error: Invalid Longitude. Enter between -180.0 to +180.0"])
38
+
39
+ h.lat = +90.1
40
+ h.lon = +180.1
41
+ expect(h.compute).to eql(["Error: Invalid Latitude. Enter between -90.0 to +90.0",
42
+ "Error: Invalid Longitude. Enter between -180.0 to +180.0"])
43
+
44
+ h.lat = -90.1
45
+ h.lon = -180.1
46
+ expect(h.compute).to eql(["Error: Invalid Latitude. Enter between -90.0 to +90.0",
47
+ "Error: Invalid Longitude. Enter between -180.0 to +180.0"])
48
+
49
+ h.lat = h.lon = 0
50
+ h.compute
51
+ expect(h.errors).to eql([])
52
+ end
53
+ end
@@ -0,0 +1 @@
1
+ require 'horoscope'
metadata CHANGED
@@ -1,16 +1,32 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: horoscope
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
5
- prerelease:
4
+ version: 0.0.3a
5
+ prerelease: 5
6
6
  platform: ruby
7
7
  authors:
8
8
  - bragboy
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-11-19 00:00:00.000000000 Z
13
- dependencies: []
12
+ date: 2013-11-26 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rspec
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
14
30
  description: Calculate the horoscope of a person given the birth date and time
15
31
  email:
16
32
  - bragboy@gmail.com
@@ -19,13 +35,27 @@ extensions: []
19
35
  extra_rdoc_files: []
20
36
  files:
21
37
  - .gitignore
38
+ - .rspec
39
+ - .travis.yml
22
40
  - Gemfile
23
41
  - LICENSE.txt
24
42
  - README.md
25
43
  - Rakefile
26
44
  - horoscope.gemspec
27
45
  - lib/horoscope.rb
46
+ - lib/horoscope/overrides/math_override.rb
47
+ - lib/horoscope/planet.rb
48
+ - lib/horoscope/planets/earth.rb
49
+ - lib/horoscope/planets/jupiter.rb
50
+ - lib/horoscope/planets/mars.rb
51
+ - lib/horoscope/planets/mercury.rb
52
+ - lib/horoscope/planets/moon.rb
53
+ - lib/horoscope/planets/nod.rb
54
+ - lib/horoscope/planets/saturn.rb
55
+ - lib/horoscope/planets/venus.rb
28
56
  - lib/horoscope/version.rb
57
+ - spec/horoscope_spec.rb
58
+ - spec/spec_helper.rb
29
59
  homepage: ''
30
60
  licenses: []
31
61
  post_install_message:
@@ -41,9 +71,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
41
71
  required_rubygems_version: !ruby/object:Gem::Requirement
42
72
  none: false
43
73
  requirements:
44
- - - ! '>='
74
+ - - ! '>'
45
75
  - !ruby/object:Gem::Version
46
- version: '0'
76
+ version: 1.3.1
47
77
  requirements: []
48
78
  rubyforge_project:
49
79
  rubygems_version: 1.8.25
@@ -51,4 +81,6 @@ signing_key:
51
81
  specification_version: 3
52
82
  summary: Calculate the accurate horoscope of a person using Vedic Horoscope technique
53
83
  given the birth time and birth place of the subject.
54
- test_files: []
84
+ test_files:
85
+ - spec/horoscope_spec.rb
86
+ - spec/spec_helper.rb