Python_2  1.0
Public Member Functions | Public Attributes | Private Member Functions | List of all members
mapper2.mapper2 Class Reference

Public Member Functions

def __init__ (self, world, viewport, ydown=True)
 Constructor. More...
 
def windowVecToViewport (self, x, y)
 Maps a single vector from world coordinates to viewport (screen) coordinates. More...
 
def viewportToWindow (self, x, y)
 Maps a single point from screen coordinates to window (world) coordinates. More...
 
def windowToViewport (self, *p)
 Maps points from world coordinates to viewport (screen) coordinates. More...
 

Public Attributes

 ys
 
 world
 Three vertices of a triangle in world coordinates. More...
 
 viewport
 Three vertices of a triangle in GPS coordinates. More...
 
 T
 Hold the world to GPS transformation matrix. More...
 
 I
 Inverse matrix of T. More...
 

Private Member Functions

def __windowToViewport (self, x, y)
 Maps a single point from world coordinates to viewport (screen) coordinates. More...
 

Constructor & Destructor Documentation

◆ __init__()

def mapper2.mapper2.__init__ (   self,
  world,
  viewport,
  ydown = True 
)

Constructor.

A linear transformation is uniquely defined by how its base vectors are transformed.

In 2D, three non-colinear points in a coordinate system A, define a base with two vectors.

Therefore, if we know the image of these three points onto another coordinate system B, the transformation that takes A -> B is defined.

Parameters
worldwindow triangle.
viewportscreen triangle.
ydownwhether Yaxis is upside down.
See also
http://www.math.ucla.edu/~baker/149.1.02w/handouts/i_affine_II.pdf

Member Function Documentation

◆ __windowToViewport()

def mapper2.mapper2.__windowToViewport (   self,
  x,
  y 
)
private

Maps a single point from world coordinates to viewport (screen) coordinates.

Parameters
x,ygiven point.
Returns
a new point in screen coordinates.

References _08c_clock.clock.T, mapper2.mapper2.T, mapper.mapper.ys, and mapper2.mapper2.ys.

Referenced by mapper2.mapper2.windowToViewport().

◆ viewportToWindow()

def mapper2.mapper2.viewportToWindow (   self,
  x,
  y 
)

Maps a single point from screen coordinates to window (world) coordinates.

Parameters
x,ygiven point.
Returns
a new point in world coordinates.

References mapper2.mapper2.I.

◆ windowToViewport()

def mapper2.mapper2.windowToViewport (   self,
p 
)

Maps points from world coordinates to viewport (screen) coordinates.

Parameters
pa variable number of points.
Returns
two new points in screen coordinates.

References mapper.mapper.__windowToViewport(), and mapper2.mapper2.__windowToViewport().

◆ windowVecToViewport()

def mapper2.mapper2.windowVecToViewport (   self,
  x,
  y 
)

Maps a single vector from world coordinates to viewport (screen) coordinates.

Parameters
x,ygiven vector.
Returns
a new vector in screen coordinates.

References _08c_clock.clock.T, mapper2.mapper2.T, mapper.mapper.ys, and mapper2.mapper2.ys.

Member Data Documentation

◆ I

mapper2.mapper2.I

Inverse matrix of T.

Referenced by mapper2.mapper2.viewportToWindow().

◆ T

mapper2.mapper2.T

Hold the world to GPS transformation matrix.

Referenced by mapper2.mapper2.__windowToViewport(), and mapper2.mapper2.windowVecToViewport().

◆ viewport

mapper2.mapper2.viewport

Three vertices of a triangle in GPS coordinates.

◆ world

mapper2.mapper2.world

Three vertices of a triangle in world coordinates.

◆ ys

mapper2.mapper2.ys

The documentation for this class was generated from the following file: