code: Coordinate getSnappingPoint(Coordinate original, double threshold) {
  		minimumDistance = Double.MAX_VALUE;
  		Coordinate snappingPoint = null;
  		double currThreshold = threshold;
  
  		List<Coordinate> coordinates = getPossibleCoordinates(original);
  		for (Coordinate coordinate : coordinates) {
  			double distance = Mathlib.distance(original, coordinate);
  			if (distance < currThreshold && distance < ruleDistance) {
  				currThreshold = distance;
  				minimumDistance = distance;
  				snappingPoint = coordinate;
  			}
  		}
  
  		return snappingPoint;
  	}
docs: Calculates a snapping point from the given coordinate.
  
  @param original
  The original and unsnapped coordinate.
  @param threshold
  A threshold value that needs to be beaten in order to snap. Only if the distance between the original
  and the candidate coordinate is smaller then this threshold, can the candidate coordinate be a snapped
  coordinate.
  @return Returns the eventual snapped coordinate, or null if no snapping occurred.