Returns the height of the surface when projected at the given angle.

    Args:
        surface (surface): the surface to project
        angle (float): the angle at which to project the surface

    Returns:
        surface: A projected surface.
10228
def project_surface(surface, angle=DEFAULT_ANGLE):
    
    z_coef = np.sin(np.radians(angle))
    y_coef = np.cos(np.radians(angle))

    surface_height, surface_width = surface.shape
    slope = np.tile(np.linspace(0., 1., surface_height), [surface_width, 1]).T

    return slope * y_coef + surface * z_coef
1072712
def _gate_height(self, gate):
        
        try:
            height = self.settings['gates'][gate.__class__.__name__]['height']
        except KeyError:
            height = .5
        return height
403533
def smoothscale(self, surface):
        
        return self._pygame.transform.smoothscale(surface, self._output_size)
804323
def get_dip(self):
        
        areas = self._get_areas()
        dips = numpy.array([surf.get_dip() for surf in self.surfaces])

        return numpy.sum(areas * dips) / numpy.sum(areas)
84856
def get_min_distance(self, mesh):
        
        dists = [surf.get_min_distance(mesh) for surf in self.surfaces]

        return numpy.min(dists, axis=0)
678534
def getOverlayAlpha(self, ulOverlayHandle):
        """"""

        fn = self.function_table.getOverlayAlpha
        pfAlpha = c_float()
        result = fn(ulOverlayHandle, byref(pfAlpha))
        return result, pfAlpha.value
1150479
def surface_to_array(surface):
    
    if hasattr(surface, 'surfaces'):  # multiplanar surfaces
        n = len(surface.surfaces)
        arr = numpy.zeros((3, n, 4), F32)
        for i, surf in enumerate(surface.surfaces):
            arr[:, i] = surf.mesh.array
        return arr
    mesh = surface.mesh
    if len(mesh.lons.shape) == 1:  # 1D mesh
        shp = (3, 1) + mesh.lons.shape
    else:  # 2D mesh
        shp = (3,) + mesh.lons.shape
    return mesh.array.reshape(shp)
116696
def surface_area(self):
        
        m = self.lattice.matrix
        return np.linalg.norm(np.cross(m[0], m[1]))
455188
def height_min(self, height_min):
        
        if height_min is None:
            self._height_limits[0] = 0
            return

        height_min = float(height_min)
        assert(height_min >= 0)

        self._height_limits[0] = height_min
        self._update_layout()
1355866
def angle(self, v):
        ''''''
        return acos((self * v) / (self.length() * v.length()))
433349
def _height_and_width(self):
        

        try:
            return self._cache['height_and_width']
        except KeyError:
            handw = self._cache['height_and_width'] = super(Terminal, self)._height_and_width()
            return handw
544537
def get_area(self):
        
        if self.area is None:
            self.area = self.to_2d().get_shapely().area
        return self.area
389341
def resize(self, dims):
        
        width, height = dims[:2]
        self.logger.debug("renderer reconfigured to %dx%d" % (
            width, height))
        if self.surface_type == 'qpixmap':
            self.surface = QPixmap(width, height)
        else:
            self.surface = QImage(width, height, self.qimg_fmt)
296393
def getTopLeft(self):
        
        return (float(self.get_x()), float(self.get_y())+ float(self.get_height()))
742757
def get_device_scale(self):
        
        size = ffi.new('double[2]')
        cairo.cairo_surface_get_device_scale(self._pointer, size + 0, size + 1)
        return tuple(size)
119501
def surface(n_x=20,n_y=20):
		
	x=[float(np.random.randint(0,100))]
	for i in range(n_x):
		x.append(x[:1][0]+np.random.randn()*np.random.randint(1,10))
	df=pd.DataFrame(x)
	for i in range(n_y):
		df[i+1]=df[i].map(lambda x:x+np.random.randn()*np.random.randint(1,10))
	return df
1290350
def get_position(self):
        
        with self._lock:
            return self.x, self.y, self.angle