Giter VIP home page Giter VIP logo

math-gmatrix's Introduction

NAME
    Math::GMatrix - Extension of Math::Matrix for (2D graphics-)vector
    manipulation

SYNOPSIS
      use Math::GMatrix;


DESCRIPTION
    The following methods are available:

  new

    Constructor arguments are a list of references to arrays of the same
    length. The arrays are copied. The method returns undef in case of
    error.

            $a = new Math::Matrix ([rand,rand,rand],
                                   [rand,rand,rand],
                                   [rand,rand,rand]);

    As s special case you can pass a single argument 'I' for getting an
    identity matrix.

    If you call "new" as method, a zero filled matrix with identical
    deminsions is returned.

  xform

    You can transform one or more vectors by calling:

            @V1=(1.5,3.7);

            @V2 = $M->xform(@V1);

            @L1=( [1.5,3.7], [4.6,6.8], [5.1,-0.7] );

            @L2 = $M->xform(@L1);


  translate

    You can pan (move by x and y offset) your graphics by calling:

            $M2 = $M->translate(2.5,10.2);


  rotate

    You can rotate your graphics by calling:

            $M2 = $M->rotate(-90);


  scale

    You can scale (factor_x and factor_y) your graphics by calling:

            $M2 = $M->rotate(2,2);


EXAMPLE
            @ListOfVectors = [
                    [0,1],
                    [3,5],
                    [2,7],
                    [8,-1]
            ];
            $paperwidth = 21;               # DIN A4 is 21x29.7 cm
            $M = new Math::Matrix('I');     # get an identity matrix
            $M = $M->translate(-1,-1)->rotate(90)->translate($paperwidth-1,1);
            @Result = $M->xform(@ListOfVectors);


AUTHOR
    A. Cester, <[email protected]>

math-gmatrix's People

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.