import math


def trajectory_is_finite(trajectory):
	"""Check if trajectory contains infinite or NaN value."""
	for point in trajectory.points:
		for position in point.positions:
			if math.isinf(position) or math.isnan(position):
				return False
		for velocity in point.velocities:
			if math.isinf(velocity) or math.isnan(velocity):
				return False
	return True