• Advertisement
Sign in to follow this  

Converting light years into astronomical units

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


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

1 light year = 63,197.7909299 astronomical units

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement