Observer constructor

Observer({
  1. required double latitude,
  2. required double longitude,
  3. double height = 0,
})

Implementation

factory Observer({
  required double latitude,
  required double longitude,
  double height = 0,
}) {
  final phi = latitude * _degree;
  final u = math.atan((1 - earthFlattening) * math.tan(phi));
  final h = height / 1000 / earthEquatorialRadius;
  return Observer._(
    latitude,
    longitude,
    height,
    (1 - earthFlattening) * math.sin(u) + h * math.sin(phi),
    math.cos(u) + h * math.cos(phi),
  );
}