Пример #1
0
 def transform(self, point):
     return Point(self.ax*point.x + self.bx*point.y + self.cx,
                  self.ay*point.x + self.by*point.y + self.cy)
Пример #2
0
 def untransform(self, point):
     return Point((point.x*self.by - point.y*self.bx - self.cx*self.by + self.cy*self.bx) / (self.ax*self.by - self.ay*self.bx),
                  (point.x*self.ay - point.y*self.ax - self.cx*self.ay + self.cy*self.ax) / (self.bx*self.ay - self.by*self.ax))
Пример #3
0
 def rawUnproject(self, point):
     return Point(point.x,
                  2 * math.atan(math.pow(math.e, point.y)) - 0.5 * math.pi)
Пример #4
0
 def rawProject(self, point):
     return Point(point.x,
                  math.log(math.tan(0.25 * math.pi + 0.5 * point.y)))
Пример #5
0
 def rawUnproject(self, point):
     return Point(point.x, point.y)
Пример #6
0
 def coordinateLocation(self, coordinate):
     coordinate = coordinate.zoomTo(self.zoom)
     point = Point(coordinate.column, coordinate.row)
     point = self.unproject(point)
     return Location(180.0 * point.y / math.pi, 180.0 * point.x / math.pi)
Пример #7
0
 def locationCoordinate(self, location):
     point = Point(math.pi * location.lon / 180.0, math.pi * location.lat / 180.0)
     point = self.project(point)
     return Coordinate(point.y, point.x, self.zoom)