Package viewer :: Package lib :: Module calculations
[hide private]
[frames] | no frames]

Module calculations

source code

Calculations routines


Author: P. Tute

Contact: henne@dcsec.uni-hannover.de

Copyright: (c) 2011, DCSec, Leibniz Universitaet Hannover, Germany

License: GPLv3

Functions [hide private]
 
lat_lon_to_tilenr(lat_deg, lon_deg, zoom)
Calculates the OpenStreetMap-tile number from given latitude, longitude and zoom.
source code
 
latlon_to_xy(lat, lon, zoom, player)
Calculates x any y coordinates for drawing based on current center-tile and zoom.
source code
 
bresenham_circle(x, y, rad)
Calculates coordinates for drawing a circle using Bresenham's circle algorithm.
source code
Variables [hide private]
  __maintainer__ = 'B. Henne'
  TILE_SIZE = 256
  __package__ = 'viewer.lib'
Function Details [hide private]

lat_lon_to_tilenr(lat_deg, lon_deg, zoom)

source code 

Calculates the OpenStreetMap-tile number from given latitude, longitude and zoom.

Author: P. Tute

latlon_to_xy(lat, lon, zoom, player)

source code 

Calculates x any y coordinates for drawing based on current center-tile and zoom.

Author: P. Tute

bresenham_circle(x, y, rad)

source code 

Calculates coordinates for drawing a circle using Bresenham's circle algorithm.

Returns a list of coordinates.

The algorithm is slightly modified to allow drawing transparent circles. http://en.wikipedia.org/wiki/Midpoint_circle_algorithm

Author: P. Tute