import math


def isnan(quat):
    """Check if any part of input quaternion is NaN."""
    if math.isnan(quat.s) or math.isnan(quat.v[0,0]) or math.isnan(quat.v[0,1]) or math.isnan(quat.v[0,2]):
        return True
    else:
        return False