def getNormalVector(v):
    """Get a vector perpendicular to the input vector"""
    if (v.x == 0) and (v.y == 0):
        if v.z == 0:
            raise ValueError('Null vector has no normal vector')
        return [0,1,0]
    return [-v.y, v.x, 0]