asteroidDiameter function

double asteroidDiameter(
  1. double h,
  2. double a
)

Asteroid diameter in km from absolute magnitude h and albedo a.

Implementation

double asteroidDiameter(double h, double a) {
  return math.pow(10, 3.12 - 0.2 * h - 0.5 * math.log(a) / math.ln10).toDouble();
}