Linear2D

  • Thread starter Lawrence D'Oliveiro
  • Start date
L

Lawrence D'Oliveiro

I've decided to give Github a go, with a simple project containing some
routines for performing 2D linear transformations
<http://github.com/ldo/linear2d/tree>.

This takes a functional rather than procedural approach. For example, a
function to construct a matrix that maps a source rectangle to a
destination rectangle is

def MapRect(SrcRect, DstRect) :
return \
(
Matrix.translation(- SrcRect.topleft())
*
Matrix.scaling(DstRect.dimensions() / SrcRect.dimensions())
*
Matrix.translation(DstRect.topleft())
)
#end MapRect
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top