private static double[] splitCoordinates(String points){
	
		String[] splitString = points.split(",");
		
		// removes opening and closing bracket for each element in 'splitString' array
		for(int i =0; i<splitString.length; i++){
			
			splitString[i] = splitString[i].replace("(", "").replace(")", "");
		}
		
		if(splitString.length == 2){
		
			double[] coOrdinates = new double[2];
			coOrdinates[0] = Double.parseDouble(splitString[0]);
			coOrdinates[1] = Double.parseDouble(splitString[1]);
			return coOrdinates;
		}
		else{
			
			double[] coOrdinates = new double[3];
			coOrdinates[0] = Double.parseDouble(splitString[0]);
			coOrdinates[1] = Double.parseDouble(splitString[1]);
			coOrdinates[2] = Double.parseDouble(splitString[2]);
			return coOrdinates;
		}
	}