Converting light years into astronomical units

This topic is 5046 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

I'm terribly bad at math and I was wondering if anyone could help me with this conversion. How do I convert light years into astronomical units? I tried searching on Google numerous times but all I get is mc = square..etc... For reference: An astronomical unit is the average distance from the Earth to the Sun (about 150,000,000 km or 93,000,000 miles) and a light year is the distance light travels in a year (about 10 trillion kilometers or 6 trillion miles). (The nearest star after the Sun is about 4.2 light years away.) Use type double (as in Listing 2.4) and this conversion factor: 1 light year = 63240 astronomical units Thanks in advance!

Share on other sites
Maybe I'm mistaken....but if you know how many astronomical units are in a light year, what are you trying to convert? Oh yea and you should read the Forum FAQ

Share on other sites
That looks suspiciously like a homework assignment.

Share on other sites
This looks suspiciously like homework ("as in Listing 2.4")

But... The math is simple enough (practically 1st grade), but I'm not going to type out the source-code..

lenghtAU = lengthLY * 63240

Share on other sites
According to www.onlineconversion.com...

1 light year = 63,197.7909299 astronomical units

Share on other sites
since 1 light year = 63240 astronomical units

AU(LY) = LY * ( 1 ly / 63240 au )
LY(AU) = AU * ( 63240 au / 1 ly )

• What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 15
• 11
• 9
• 9
• 42
• Forum Statistics

• Total Topics
634131
• Total Posts
3015715
×