altitude function

num altitude(
  1. num H,
  2. num phi,
  3. num dec
)

Implementation

num altitude(num H, num phi, num dec) {
  return math.asin(math.sin(phi) * math.sin(dec) +
      math.cos(phi) * math.cos(dec) * math.cos(H));
}