GeoAngle constructor

GeoAngle({
  1. double? degree,
  2. double? radian,
})

Constructor for GeoAngle. Either degree or radians must be defined, but NOT both.

Implementation

GeoAngle({double? degree, double? radian})
    : assert((degree != null) ^ (radian != null)) {
  if (degree != null) {
    this.degree = degree;
    this.radian = degree * pi / 180;
  } else if (radian != null) {
    this.radian = radian;
    this.degree = radian * 180 / pi;
  } else {
    degree = 0;
    radian = 0;
  }
}