Skip to content

Simple program to calculate how far away the Voyager probes are from the Sun

License

Notifications You must be signed in to change notification settings

camdendotlol/voyagerstatus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Voyager Status

This program calculates how far away Voyager 1 and 2 are from the Sun.

Example image showing the program in use with Voyager 1 and 2

Usage

  1. Compile voyagerstatus.c for your system, e.g. cc voyagerstatus.c -o voyagerstatus.
  2. Run the binary: ./voyagerstatus. This will run Voyager Status with the default settings, which display both probes' distance in kilometers.

I made this to put in my .zshrc so I get a little reminder every time I open my terminal.

Installing

You can run the program directly after downloading and compiling, but you can also add it to your PATH for easier access.

These instructions assume zero knowledge of setting up a command and provide reasonable defaults for new users.

  1. Create ~/.local/bin if it doesn't already exist.
  2. Move the voyagerstatus binary to ~/.local/bin.
  3. You might have to run chmod +x on the binary to give it execution permissions. If you're on a Mac, you might also need to follow these steps before your computer allows you to run it.
  4. Make sure ~/.local/bin is in your PATH (see here for a how-to).
  5. Now you can run voyagerstatus from your terminal.

Options

There are a handful of launch options available.

Distance units

By default, voyagerstatus give the distance in kilometers.

-m: Show the distance in miles

I want to add support for astronomical units in the future.

Pick a probe

If neither is specificed, both will be shown. To only display one, use its corresponding launch argument.

-v1: Display the distance of Voyager 1
-v2: Display the distance of Voyager 2

Color

You can optionally choose a color to print the text in.

The argument to set the color is --color=name where name is:

  • red
  • blue
  • green
  • cyan
  • black
  • yellow
  • purple
  • white

Your terminal environment might display colors differently depending on theme, etc.

Examples:

$ voyagerstatus 
Voyager 1 is 23,175,356,063 kilometers from the Sun.
Voyager 2 is 19,281,902,403 kilometers from the Sun.
$ voyagerstatus -v2 -m
Voyager 2 is 12,045,896,105 miles from the Sun.
$ voyagerstatus -v1 --color=red
Voyager 1 is 23,294,958,078 kilometers from the Sun. # You can't see the color here on GitHub.

Bash version

This program was originally a Bash script that I ported to C in 2023. You can still access the Bash script if you check the git history.

Other info

I want to add an option for distance from the Earth, because that sounds a lot more interesting. But it requires some extra math due to the Earth's orbit. In fact, for part of the year the Voyager probes get closer to Earth, because the Earth's orbit moves us toward the Voyagers at a faster velocity than the Voyagers are moving away. So it'll be a bit of a challenge to pin down the math for that. But I plan to do it.

About

Simple program to calculate how far away the Voyager probes are from the Sun

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages