topocentricToLookAngles function

Map<String, dynamic> topocentricToLookAngles(
  1. Map<String, dynamic> tc
)

@param {Object} tc @param {Number} tc.topS Positive horizontal vector S due south. @param {Number} tc.topE Positive horizontal vector E due east. @param {Number} tc.topZ Vector Z normal to the surface of the earth (up). @returns {Object}

Implementation

Map<String, dynamic> topocentricToLookAngles(Map<String, dynamic> tc) {
  final topS = tc['topS'];
  final topE = tc['topE'];
  final topZ = tc['topZ'];
  final rangeSat = Math.sqrt((topS * topS) + (topE * topE) + (topZ * topZ));
  final El = Math.asin(topZ / rangeSat);
  final Az = Math.atan2(-topE, topS) + pi;

  return {
    'azimuth': Az,
    'elevation': El,
    'rangeSat': rangeSat, // Range in km
  };
}