import math


def angleFromString(angleStr):
	"""Converts from an angle string to a float angle in radians."""
	if len(angleStr) > 3 and angleStr[-3:] == 'deg':
		return math.radians(float(angleStr[:-3]))
	elif len(angleStr) > 4 and angleStr[-4:] == 'grad':
		return float(angleStr[:-4])*math.pi/200.0
	elif len(angleStr) > 3 and angleStr[-3:] == 'rad':
		return float(angleStr[:-3])
	elif len(angleStr) > 4 and angleStr[-4:] == 'turn':
		return float(angleStr[:-4])*2.0*math.pi
	return math.radians(float(angleStr))