def cm2deg(cm, monitor, correctFlat=False):
 if (not isinstance(monitor, monitors.Monitor)):
  msg = 'cm2deg requires a monitors.Monitor object as the second argument but received %s'
  raise ValueError((msg % str(type(monitor))))
 dist = monitor.getDistance()
 if (dist is None):
  msg = 'Monitor %s has no known distance (SEE MONITOR CENTER)'
  raise ValueError((msg % monitor.name))
 if correctFlat:
  return np.arctan(np.radians((cm / dist)))
 else:
  return (cm / (dist * 0.017455))

def cm2deg ( cm , monitor , correctFlat = False ) : if ( not isinstance ( monitor , monitors . Monitor ) ) : msg = 'cm2deg requires a monitors.Monitor object as the second argument but received %s' raise ValueError ( ( msg % str ( type ( monitor ) ) ) ) dist = monitor . getDistance ( ) if ( dist is None ) : msg = 'Monitor %s has no known distance (SEE MONITOR CENTER)' raise ValueError ( ( msg % monitor . name ) ) if correctFlat : return np . arctan ( np . radians ( ( cm / dist ) ) ) else : return ( cm / ( dist * 0.017455 ) )
convert size in cm to size in degrees for a given monitor object .