normalize the lat lon values of this to ensure that no large longitude
jumps are made from lastPosition (e.g. 179 to -180)

@param lastPosition
559265
public final Position ensureContinuous(Position lastPosition) {
        double lon = this.lon;
        if (abs(lon - lastPosition.lon) > 180) {
            if (lastPosition.lon < 0)
                lon -= 360;
            else
                lon += 360;
            return new Position(lat, lon);
        } else
            return this;

    }
654202
public void setLongitude(final String longitude) {
    if(StringUtils.isBlank(longitude)) {
      return;
    }
    try {
      setLongitude(Double.parseDouble(longitude.trim()));
    }
    catch(Exception e) {
      // nothing is set
    }
  }
82255
def longitude(value):
    
    lon = round(float_(value), 5)
    if lon > 180.:
        raise ValueError('longitude %s > 180' % lon)
    elif lon < -180.:
        raise ValueError('longitude %s < -180' % lon)
    return lon
432605
public void setGeo(String geo) {
    if(geo != null) {
      geo = geo.trim();
    }

    if(StringUtils.isBlank(geo)) {
      this.geo = geo;
      setLatitude(Constants.DEFAULT_LATITUDE);
      setLongitude(Constants.DEFAULT_LONGITUDE);
      return;
    }

    String[] split = geo.split("\\s+");
    if(split != null && split.length == 2) {
      this.geo = split[0].trim() + " " + split[1];
      setLatitude(split[0]);
      setLongitude(split[1]);
    }
  }
195299
def assert_is_lon(val):
    
    assert type(val) is float or type(val) is int, "Value must be a number"
    if val < -180.0 or val > 180.0:
        raise ValueError("Longitude value must be between -180 and 180")
1217962
public static void normalize(Point3d point) {
        double sum = Math.sqrt(point.x * point.x + point.y * point.y + point.z * point.z);
        point.x = point.x / sum;
        point.y = point.y / sum;
        point.z = point.z / sum;
    }
482380
function (positionChange) {
                var _this = this;
                /** @type {?} */
                var pointLimits = this.limitDirections.filter(function (direction) {
                    return !positionChange.roles.includes(direction);
                });
                /** @type {?} */
                var limitException = {
                    exceeds: false,
                    resetCoefficients: {
                        x: 0,
                        y: 0
                    },
                    resetCoordinates: {
                        x: positionChange.x,
                        y: positionChange.y
                    }
                };
                // limit directions are the opposite sides of the point's roles
                pointLimits.forEach(function (direction) {
                    /** @type {?} */
                    var directionAxis = _this.getDirectionAxis(direction);
                    if (direction === 'top' || direction === 'left') {
                        if (positionChange[directionAxis] < _this._limits[direction]) {
                            limitException.resetCoefficients[directionAxis] = 1;
                            limitException.resetCoordinates[directionAxis] = _this._limits[direction];
                        }
                    }
                    else if (direction === 'right' || direction === 'bottom') {
                        if (positionChange[directionAxis] > _this._limits[direction]) {
                            limitException.resetCoefficients[directionAxis] = -1;
                            limitException.resetCoordinates[directionAxis] = _this._limits[direction];
                        }
                    }
                });
                if (limitException.resetCoefficients.x !== 0 || limitException.resetCoefficients.y !== 0) {
                    limitException.exceeds = true;
                }
                return limitException;
            }
78824
def relocate(self, lon):
        
        self.lon = angle.norm(lon)
        self.signlon = self.lon % 30
        self.sign = const.LIST_SIGNS[int(self.lon / 30.0)]
241319
public void setLastPoint(double x, double y, double z) {
		if (this.numCoords>=3) {
			this.coords[this.numCoords-3] = x;
			this.coords[this.numCoords-2] = y;
			this.coords[this.numCoords-1] = z;
			this.graphicalBounds = null;
			this.logicalBounds = null;
		}
	}
698962
def add_lat_lon(self, lat, lon, precision=1e7):
        """"""
        self._ef["GPS"][piexif.GPSIFD.GPSLatitudeRef] = "N" if lat > 0 else "S"
        self._ef["GPS"][piexif.GPSIFD.GPSLongitudeRef] = "E" if lon > 0 else "W"
        self._ef["GPS"][piexif.GPSIFD.GPSLongitude] = decimal_to_dms(
            abs(lon), int(precision))
        self._ef["GPS"][piexif.GPSIFD.GPSLatitude] = decimal_to_dms(
            abs(lat), int(precision))
662801
def set_last_position(self, last_position):
        
        if last_position is None:
            self.last_position = {}
            for partition in self.partitions:
                self.last_position[partition] = 0
            self.consumer.offsets = self.last_position.copy()
            self.consumer.fetch_offsets = self.consumer.offsets.copy()
        else:
            self.last_position = last_position
            self.consumer.offsets = last_position.copy()
            self.consumer.fetch_offsets = self.consumer.offsets.copy()
1015296
public void latlonToEqui(float lat, float lon, Point2D_F32 rect) {
		rect.x = UtilAngle.wrapZeroToOne(lon / GrlConstants.F_PI2 + 0.5f)*width;
		rect.y = UtilAngle.reflectZeroToOne(lat / GrlConstants.F_PI + 0.5f)*(height-1);
	}
1268632
def set_query_latlon(self):
        '''
        
        '''

        if (isinstance(self.longitude, list) and
                isinstance(self.latitude, list)):
            self.lbox = True
            # west, east, south, north
            self.query.lonlat_box(self.longitude[0], self.longitude[1],
                                  self.latitude[0], self.latitude[1])
        else:
            self.lbox = False
            self.query.lonlat_point(self.longitude, self.latitude)
1023850
public static double setDistanceEpsilon(double newPrecisionValue) {
		if ((newPrecisionValue >= 1) || (newPrecisionValue <= 0)) {
			throw new IllegalArgumentException();
		}
		final double old = distancePrecision;
		distancePrecision = newPrecisionValue;
		return old;
	}
856992
public int convertBoundaryToRelativePosition(int absolutePosition) {
        if (absolutePosition < lower || absolutePosition > upper)
            throw new IllegalArgumentException("Position outside this range (" + absolutePosition + ") this=" + this + ".");

        if (reversed)
            return upper - absolutePosition;
        else
            return absolutePosition - lower;
    }
8301
public void setSplitterPosition(int position) {
        mSplitterPosition = clamp(position, 0, Integer.MAX_VALUE);
        mSplitterPositionPercent = -1;
        remeasure();
        notifySplitterPositionChanged(false);
    }
532141
public final void normalize() {
		double norm;

		norm = (this.x*this.x + this.y*this.y + this.z*this.z + this.w*this.w);

		if (norm > 0f) {
			norm = 1f / Math.sqrt(norm);
			this.x *= norm;
			this.y *= norm;
			this.z *= norm;
			this.w *= norm;
		} else {
			this.x = 0f;
			this.y = 0f;
			this.z = 0f;
			this.w = 0f;
		}
	}