A star's visual magnitude can be computed from its absolute magnitude and distance with the following formula: