def max_sway_AP_ML(signal):
	""" Returns maximal sway values for mediolateral (x) and anterioposterior (y) directions
	Input: 
	signal  --  2-dim array with shape (channel, samples) 
				(on the index 0 - samples from channel x, on index 1 - samples from channel y) 
	Output:
	max_sway 	--	float 
	max_AP   	--  float
	max_ML  	--  float
	"""

	resultant_distance = np.sqrt((signal[0]-np.mean(signal[0]))**2+(signal[1]-np.mean(signal[1]))**2)
	distance_AP = signal[1]-np.mean(signal[1])
	distance_ML = signal[0]-np.mean(signal[0])
	return max(resultant_distance), max(np.abs(distance_AP)), max(np.abs(distance_ML))