Discussion | Articles | Blogs | Books | Contact Us | Chat | Shop |
  WrongPlanet.net
User Stats

   Members: 31,124
   Online Now: 537



People Online:
Visitors: 413
Members: 124
New Today: 11
New Yesterday: 20
Latest: Movingforward

  Aspie Affection
Support Wrong Planet Awareness!
Astronomy/astrology/maths help needed

 
Post new topic   Reply to topic    Wrong Planet Forums Forum Index -> Computers, Math, Science, and Technology
View previous topic :: View next topic  
Author Message
FePixie
Raven
Raven


Joined: Oct 30, 2008
Posts: 104
Location: NZ

PostPosted: Tue Jul 07, 2009 8:33 pm    Post subject: Astronomy/astrology/maths help needed Reply with quote

Can anyone help me with an equation that calculates the longitudinal position of the moon for any given day and time? (eg which constellation its in for each day)

Also calculation for working out planetary transit times for the major planets...

I dont want to download the dataset - i want the calculation to work out the data.... some big long mathematical gibble that i can translate to php

So far i've made scripts to calculate...
* sun rise and set times from any long/lat
* suns daily longitudinal position (what starsign/constellation its in)
* moon phase (full moon, new moon etc)

But i'm a bit stuck on these more difficult calculations....

Anyone?
Back to top
View user's profile Send private message Visit poster's website
lau
Really nice person to know. :)
Administrator


Joined: Jun 18, 2006
Age: 60
Posts: 9478
Location: Somerset UK

PostPosted: Wed Jul 08, 2009 9:00 am    Post subject: Reply with quote

I wrote an ephemeris program, in BASIC, some 28 (*) years ago.

The sun... pretty simple.

The planets... none were terribly hard, but I seem to recall Mercury being the worst. They mostly require odd "tweaks" to their calculation, to accommodate interactions with each other.

The moon... a complete nightmare. Nothing about it is simple. I think I finally settled with code that rambled on for quite a while, and at least managed ten years with tolerably accurate results.

At the time, I was working for a software house (Zeus-Hermes) in Tottenham Court Road, London, and I used just about every source of information. That included the Library Special Collection for mathematics, University College's library, and the Patent Office (who have an amazingly large technical library).

The bad news... I no longer have the program.

(*) I say 28 years, because I was also working on the first IBM PCs to get into the UK (via a "back door").
_________________
"Striking up conversations with strangers is an autistic person's version of extreme sports." Kamran Nazeer
Back to top
View user's profile Send private message Visit poster's website
FePixie
Raven
Raven


Joined: Oct 30, 2008
Posts: 104
Location: NZ

PostPosted: Wed Jul 08, 2009 9:15 am    Post subject: Reply with quote

Awesome Very Happy

Wunna learn php? Laughing

I've found this which seems to be the calculations needed for the planets

http://www.davidcolarusso.com/astro/

now i just need that converted to english or phpish or some other computerish i can understand

I'm stuck at step 2 - in that the variables they ask for arnt the ones supplied in the dataset they say to use... Shocked

have i got the right ones? http://ssd.jpl.nasa.gov/txt/p_elem_t1.txt

they give me a,e,I,L,long.peri,long.node
but ask for a,r,P,v,E,e


Geez - an example would be a handy thing on these maths gibberish bits.... Embarassed
Back to top
View user's profile Send private message Visit poster's website
lau
Really nice person to know. :)
Administrator


Joined: Jun 18, 2006
Age: 60
Posts: 9478
Location: Somerset UK

PostPosted: Wed Jul 08, 2009 10:40 am    Post subject: Reply with quote

You could always download the source code for "kstars", say, and find out how that does it all.

Note that the link you gave states quite clearly that it does not handle the moon. The planetary data seems to be all just rely on the simple orbital parameters stuff, omitting any attempt at handling perturbations... which is accurate enough for the limited span the flash animation there permits (2000 - 2015).

You could, of course, ask someone at an astrology site how their code does it. I wonder how much they would charge you, to supply you with some trivial code that works for a year or two, and which is probably just using a bunch of poorly interpolated data copied out of a book of tables.
_________________
"Striking up conversations with strangers is an autistic person's version of extreme sports." Kamran Nazeer
Back to top
View user's profile Send private message Visit poster's website
FePixie
Raven
Raven


Joined: Oct 30, 2008
Posts: 104
Location: NZ

PostPosted: Wed Jul 08, 2009 7:48 pm    Post subject: Reply with quote

Yeah - i know its not the moon one... it should do fine for the planets though - if i can get it translated... And can figure what the starting data should be Confused

That flash animation is cute huh?

I'll need to find the moon calculations somewhere still...
Back to top
View user's profile Send private message Visit poster's website
idle
Tufted Titmouse
Tufted Titmouse


Joined: Nov 24, 2008
Posts: 27
Location: Auckland New Zealand

PostPosted: Thu Jul 09, 2009 7:35 pm    Post subject: Reply with quote

is this the one you want?

http://ssd.jpl.nasa.gov/txt/aprx_pos_planets.pdf

from this page

http://ssd.jpl.nasa.gov/?planet_pos
Back to top
View user's profile Send private message Visit poster's website
FePixie
Raven
Raven


Joined: Oct 30, 2008
Posts: 104
Location: NZ

PostPosted: Thu Jul 09, 2009 9:27 pm    Post subject: Reply with quote

Hi Idle

Yep - thats the one i've got - but the variables it asks for aren't the ones supplied in the tables - or they call em something different and i don't know which ones to use....

they give me a,e,I,L,long.peri,long.node
but ask for a,r,P,v,E,e
Back to top
View user's profile Send private message Visit poster's website
idle
Tufted Titmouse
Tufted Titmouse


Joined: Nov 24, 2008
Posts: 27
Location: Auckland New Zealand

PostPosted: Thu Jul 09, 2009 10:39 pm    Post subject: Reply with quote

Are you looking at the PDF? it seems to look right in there!
Back to top
View user's profile Send private message Visit poster's website
pakled
"Bless his Heart"
Phoenix


Joined: Nov 13, 2007
Age: 52
Posts: 6736

PostPosted: Fri Jul 10, 2009 1:56 am    Post subject: Reply with quote

A couple of centuries (well, maybe more), someone in Europe came up with a way of using the moon to navigate with. It's long since been replaced by accurate timepieces and gyros and whatnot, but I wouldn't be surprised if there's something on the web about the original method. Having to know where the moon is would probably entail knowing where in the sky it would be at given times and dates.
Back to top
View user's profile Send private message
FePixie
Raven
Raven


Joined: Oct 30, 2008
Posts: 104
Location: NZ

PostPosted: Fri Jul 10, 2009 7:23 am    Post subject: Reply with quote

ok - so this must still have something missing - can anyone help with what else i need to do? All i want is the starsign for each day...

Code:

<?php

// Keplerian elements and their rates, with respect to the mean ecliptic
// and equinox of J2000, valid for the time-interval 1800 AD - 2050 AD.

// venus
$Lo=       181.97909950; // mean longitude [degrees]
$LC=       58517.81538729; // mean longitude [degrees/century]

$month = 3;
$year = 2010;
$hour = 04;
$min = 00;
$sec = 00;

$signs = array (0 => 'Aries', 'Taurus', 'Gemini', 'Cancer', 'Leo', 'Virgo', 'Libra', 'Scorpio', 'Sagittarius', 'Capricorn', 'Aquarius', 'Pisces');

for ($day=1;$day<32;$day++) {

$phpdate = mktime($hour,$min,$sec,$month,$day,$year);
$julianDate = gregoriantojd($month, $day, $year);

  //correct for half-day offset
  $dayfrac = date('G',$phpdate) / 24 - .5;
  if ($dayfrac < 0) $dayfrac += 1;

  //now set the fraction of a day
  $frac = $dayfrac + (date('i',$phpdate) + date('s',$phpdate) / 60) / 60 / 24;
  $julianDate = $julianDate + $frac;
   
$Teph = $julianDate;

// number of centuries past J2000.0
$T = (($Teph - 2451545.0)/36525);

// compute value of elements for date
$L = ($Lo+($LC*$T));

// remove whole circles
$z = fmod($L,360);

// find the starsign
$sign_num = floor($z / 30);

$thedate = date("d-m-Y",$phpdate);
echo "$thedate - $z - $sign_num - $signs[$sign_num]<br />";

}

 ?>


output
Code:

01-03-2010 - 10.1554881252 - 0 - Aries
02-03-2010 - 11.7576185944 - 0 - Aries
03-03-2010 - 13.3597490636 - 0 - Aries
04-03-2010 - 14.9618795328 - 0 - Aries
05-03-2010 - 16.564010002 - 0 - Aries
06-03-2010 - 18.1661404712 - 0 - Aries
07-03-2010 - 19.7682709404 - 0 - Aries
08-03-2010 - 21.3704014096 - 0 - Aries
09-03-2010 - 22.9725318788 - 0 - Aries
10-03-2010 - 24.574662348 - 0 - Aries
11-03-2010 - 26.1767928172 - 0 - Aries
12-03-2010 - 27.7789232864 - 0 - Aries
13-03-2010 - 29.3810537555 - 0 - Aries
14-03-2010 - 30.9831842247 - 1 - Taurus
15-03-2010 - 32.5853146939 - 1 - Taurus
16-03-2010 - 34.1874451631 - 1 - Taurus
17-03-2010 - 35.7895756323 - 1 - Taurus
18-03-2010 - 37.3917061015 - 1 - Taurus
19-03-2010 - 38.9938365707 - 1 - Taurus
20-03-2010 - 40.5959670399 - 1 - Taurus
21-03-2010 - 42.1980975091 - 1 - Taurus
22-03-2010 - 43.8002279783 - 1 - Taurus
23-03-2010 - 45.4023584475 - 1 - Taurus
24-03-2010 - 47.0044889167 - 1 - Taurus
25-03-2010 - 48.6066193859 - 1 - Taurus
26-03-2010 - 50.2087498551 - 1 - Taurus
27-03-2010 - 51.8108803243 - 1 - Taurus
28-03-2010 - 53.4130107934 - 1 - Taurus
29-03-2010 - 55.0151412626 - 1 - Taurus
30-03-2010 - 56.6172717318 - 1 - Taurus
31-03-2010 - 58.219402201 - 1 - Taurus
Back to top
View user's profile Send private message Visit poster's website
FePixie
Raven
Raven


Joined: Oct 30, 2008
Posts: 104
Location: NZ

PostPosted: Tue Jul 14, 2009 12:18 am    Post subject: Reply with quote

hmm - ok - i get it - thats the heliocentric (as seen from the sun) bit - next it needs adjusted to allow for geocentric (view from earth) changes...

eerrrm - yeah
solving keplars equation in php - ????

.... * goes back to thinkin on that one for a while longer * ....
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Wrong Planet Forums Forum Index -> Computers, Math, Science, and Technology All times are GMT - 5 Hours
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Wrong PlanetTM Copyright 2004-2009, Alex Plank and Yellow Sneaker Media, LLC
Alex Plank  Aspie Affection 

Terms of Service - You must read this as a user of Wrong Planet

RSS Feed Add to Google Add to My Yahoo!

Subscribe: Wrong Planet News  Wrong Planet Forums

Privacy Policy

Asperger's is not a disease

fine art