#!/usr/bin/perl
#
# Calculate a series of x,y datapairs which
#   correspond to different power laws
#   for comparison with HR diagram.
#
# MWR 1/9/2026

$debug = 0;

$sun_temp = 5780.0;

$xmin = 4000.0;
$xmax = 8000.0;
$dx = 50.0;

# first, we do a stanza with power-law exponent 4.0
printf "#  slope 4.0 \n";
$power = 4.0;
$coeff = 0.8 / ($sun_temp**$power);
for ($x = $xmin; $x <= $xmax; $x += $dx) {
  $y = $coeff*($x**$power);

  printf " %8.1f  %14.6f \n", $x, $y;
}
printf "\n\n";

# next, we do a stanza with power-law exponent 7.0
printf "#  slope 7.0 \n";
$power = 7.0;
$coeff = 0.8 / ($sun_temp**$power);
for ($x = $xmin; $x <= $xmax; $x += $dx) {
  $y = $coeff*($x**$power);

  printf " %8.1f  %14.6f \n", $x, $y;
}
printf "\n\n";


exit 0;
