import math


def cs_h(c, R):
    """Height of the circular segment, given its radius R and chord
    length c See: [http://en.wikipedia.org/wiki/Circular_segment]

    """
    if c >= 2*R:
        print('WARNING: the chord is greater than the diameter!')
        print('WARNING: returning maximum height, the radius')
        return R
    else:
        return R - math.sqrt( R**2 - (c**2/4) )