handling matrix\math


Hi asaf,.

I just read about that and got your VI. Still having a problem with that?

I'm still a little unclear on what you are trying to do. In order to clarify this point, I opened your VI using LabVIEW 2011, but I see that you have a broken wire. I'm not really sure what it is for. I see that you use the option add up all the elements in table VI. This function will return the value of the sum will everything in your table (in this case, the items in the table fo 21) If your goal is to feed this into a 2Darray matrix, you can simply use the function "insert table".

I think it would be useful to go back to the initial problem statement and to clarify some things about him. A very high level, you said that you have a table of 21 elements you want to manipulate. How you are willing to handle. I see the amounts are expected to find themselves in the matrix, but what determines which line/column, it will in? "" I think it will help to be able to use the various functions of table you will find in right click on the block diagram ' programming ' table.

This section of development Zone shows a little on how to create arrays and clusters. He explains a little more about the different features of table. You can also try using context-sensitive help or by clicking on "detailed help" in this window to learn more about the service.

I hope this helps!

Tags: NI Software

Similar Questions

  • Reverse and pseudo inverse Matrix on FPGA

    Hi all

    How can I calculate matrix inverse/pinv on pushed more logical clock (*.gcdl), for FPGA? (Labview Comms 2.0)
    Maybe someone has a solution for this task? Or that the best algorithm I use for this task?

    Thank you.

    Hello togoto,.

    We have matrix Inverse and matrix screw Pseudo-inverse for code side host, but these are not supported on FPGA. The reason for this is because without a known matrix size, there is not a way to implement a dynamic matrix math function (the compiler couldn't know how many resources which requires). If we consider that more algorithms of inverse depend on the division, which is very intensive on FPGA resources, which provides another reason why we would be unable to put implementation in CDL.

    That being said, Comms has Matrix multiply and transpose the matrix of features that you can implement in CDL. Because for a long time the matrices are always a fixed size and uniform, you can implement a custom algorithm to achieve pseudoinversion and matrix inversion. It would take careful pipelining to ensure it worked in a single clock cycle.

    Could you elaborate on what exactly the application is supposed to accomplish? If possible, the math movement matrix your screw host-side may be the best approach.

    Best,

    Daniel

  • Problems of cursor alpha in Flash CS4

    Does anyone else have problem with the cursor of the Alpha (effect of color > Alpha) don't go all the way to 0% or 100%? A lot of the time, I can get up to 99% or 1%, even if I manually enter the values in the text box with the cursor. Some of the time, it even will not take a manual entry in the text box. For example, if the cursor is set at 65%, I can enter 0%, and he'll be just fine back to 65%.

    OK, so what is happening out there is that you use the matrix math in the property inspector. The matrix is make calculations and arrives at numbers, sort of "guess" what you want in the way of interpolation with a borough and all involved. What happens much more frequently for X-values and Y and transformations such as rotation or inclination, less frequently for alpha. Why you won't see that this in the motion Editor (motion even hot text editor) is because you set the property directly.

    This isn't new to Flash, but it's something you see a lot more when you use hot text sliders you do more calculations when moving (a calculation each time), so things like rounding down value more «» We have an enhancement request always set properties directly (so), but because it would change the way all in Flash has worked since the beginning (essentially ' getting rid of the calculation of the matrix"), it's a pretty huge and risky demand would be a great to have

  • Math / table / matrix-question

    Hello everyone,

    first of all: it is not an indesignscripting - but general math-javascriptquestion. Please be patient

    I have a first (matrixlike-) table (will not change)

    var = [] containers
    'container11', 'container12', 'container13', 'container14', 'container15 ',.
    'container21', 'container22', 'container23', 'container24', 'container25 ',.
    'container31', 'container32', 'container33', 'container34', 'container35 ',.
    'container41', 'container42', 'container43', 'container44', 'container45 ',.
    'container51', 'container52', 'container53', 'container54', 'container55 '.
    ];

    and I have a second table:

    ["container14", "container25", "container34", "container44", "container54"] //this array may contain 3 up to 8 items
    

    My goal is to check if a 5 to 3 points in the second array is part of where equal to a row or column of the matrix-like-table.

    For example: 'container34', 'container44', 'container54' or 'container11', 'container12', 'container13', 'container14' (in the context of the second table) would be a result I #m you are looking for. Note: I just want to find the 'tax to the largest!

    Hope it becomes clear and one of math-cracks will have an idea.

    Excess: there is no DUTY to work with arrays. I can also store the data to an object or a mixture... and can fill with numbers instead of strings...

    To get visible:

    https://DL.dropboxusercontent.com/Spa/3ftsuc9opmid3j4/exports/fourWins/fourWins.html

    Items can slip and fall. After every dropp the berries should be compared... and I #m looking for a nice and elegant solution

    Maybe someone is interested

    Hans

    Hello Hans,.

    Just a little note well that your issue is resolved.

    As long as your matrix is 5 × 5 you can easily map any element into a single character throughout {A, b,..., Z} (for example).

    Then your problem can be reduced to a pattern match algorithm, i.e. to find the longest part of the input string in a 'flat' string that concatenates simply lines and columns of the matrix search namely ROW1. ROW2...| Col1| COL2... | Col5

    And you can create a RegExp on the fly to calculate the solution (s) with almost no effort:

    const MX_ORDER = 5;
    const MIN_MATCH = 3; // We need at least 3 contiguous items
    
    var bestMatrixMatch = function F(/*str[]*/ROWS, /*str*/ND)
    //--------------------------------------
    // NB: No check is made on ROWS, so make sure you supply
    //     MX_ORDER strings, each being MX_ORDER-sized
    {
        // Put in cache some subroutines
        // ---
        F.RES_TO_STR ||(F.RES_TO_STR = function()
            {
                return localize("'%1' found in %2", this.result, this.location);
            });
        F.ROWS_TO_HS ||(F.ROWS_TO_HS = function(R, C,i,j)
            {
                for( i=0,C=[] ; i < MX_ORDER ; ++i )
                for( C[i]='',j=0 ; j < MX_ORDER ; C[i]+=R[j++][i] );
                return R.concat(C).join('|');
            });
    
        // Vars
        // ---
        var haystack = F.ROWS_TO_HS(ROWS),
            candidates = ND &&
                haystack.match( new RegExp('['+ND+']{'+MIN_MATCH+',}','g') ),
            t, p;
    
        if( !candidates ) return null;
    
        // Sort the candidates by increasing size
        // ---
        candidates.sort( function(x,y){return x.length-y.length} );
    
        // Grab the matches and keep the best
        // ---
        while( t=candidates.pop() )
            {
            if( 0 > ND.indexOf(t) ) continue;
            p = 1+~~(haystack.indexOf(t)/(1+MX_ORDER));
            return {
                result:   t,
                location: (p<=MX_ORDER)?('Row #'+p):('Col #'+(p-MX_ORDER)),
                toString: F.RES_TO_STR,
                }
            }
        return null;
    }
    
    // =================
    // Sample code
    // =================
    
    var rows = [
        "ABCDE",
        "FGHIJ",
        "KLMNO",
        "PQRST",
        "UVWXY"
        ];
    var needle = "EKLMINSX";
    
    // get the result
    // ---
    var result = bestMatrixMatch(rows, needle);
    alert(
        "Searching the longest part of '" + needle + "' in:\r\r" +
        ' '+rows.join('\r').split('').join(' ') +
        '\r\r===============\r\r' +
        (result || "No result.")
        );
    

    @+

    Marc

  • Premium HP: HP Premium: PROGRAM FOR DOING MATRIX OF BATTERY of the CALCULATOR (don't DO NOT WORK!)

    Hello!

    I attend the University for electrical engineering, and so I plan to buy a good calculator for my needs:

    -programmable with enough memory

    -graphical representation

    -"Advanced" math

    I have not discovered only recently on the amazing HP calculators (e.g. HP 50 g), which are capable of the RPN notation and thus make the calculations very fast and effective. I really hate the new calculators that announce the entry "quick and easy" using graphic symbols and cursor to select the location of the entrance! It of a lot of your time and makes me crazy, especially when it comes to long and "complex" calculations

    As I am not able to get the new HP 50 g, I looked at his "successor": first HP. But unfortunately there many defects in the RPN notation and also in some functions. But I'm willing to compromise, especially if I can write programs to replace some missing critical functions of HP 50 G.

    BUT, when I started looking into writing my own duties I quickly discovered that the lack of management functions of the inputs/outputs and even some strange/inexplicable behaviors.

    I wrote a program:

    EXPORT array()
    BEGIN
    LOCAL a, b, i, j;
    a: = years (1);
    IF length (a) == 1
    THEN
    b: = MAKELIST (years (X), X, a + 1, 2,-1);
    ON THE OTHER
    i: = a (1);
    j: = a (2);
    b: = MAKEMAT (years (i + j + 2 - J-(I-1) * j), i, j);
    END;

    (b) return;

    This program takes the last argument ("a") of stack for the size of the list/matrix.

    If the argument 'a' is a number (list 1 item), it creates a list of the last 'a' arguments from the stack. -> WORK

    Otherwise, it creates a matrix with columns and the specified lines. -> DOES NOT

    Now when I tested the code without I or J arguments MAKEMAT service, she worked OK. He worked too, if I used a very simple expression: for example I have J-1 or i + j - J + 2 (column only scanning).

    (The upper part (1 expression in the stack is the return value after execution of Array ()))

    OK LIST:

    MATRIX not OK:

    MATRICES OK, so current of enforcement only of years (i + j - J + 2):

    MATRIX OK, so current execution really simple Ans(I+J-1) function:

    Why these anomalies! I was really looking forward to buy HP Prime, but after all these issues and no real control on the stack of the calculator for the impressive programs

    HP 50 g has built in functions for these conversions, but more recent first HP does not work.

    All the best,

    Ziga

    And summarize the features of the program:

    Make a list of last wrote the number (one being 1: command):

    Make a matrix using a schema = {i, j} (a being list in 1: command):

    The array() function:

    EXPORT array()
    BEGIN
    LOCAL a, b, i, j;
    a: = years (1);
    (A) IF size == 1
    THEN
    b: = MAKELIST (years (X), X, a + 1, 2,-1);
    ON THE OTHER
    i: = a (1);
    j: = a (2);
    b: = MAKEMAT (years (i * j - J + 2-(I-1) * j), i, j);
    END;
    (b) return;
    END;

  • Place the dimension table of DLL handle size

    Hello

    What is the correct way to handle the transition matrix dimensions, I found this document, outlining only the memory and situation examples that indicate the following two possibilities:

    typedef struct {}
    dimSizes [measures]
    ArrDatatype data [1];
    } Array * ArrayHdl;

    or this one:

    typedef struct {}
    dimSize1 of Int32;
    .
    .
    .
    .
    dimSizeX of Int32;
    ArrDatatype data [1];
    } Array * ArrayHdl;

    Bublina wrote:

    Hello

    What is the correct way to handle the transition matrix dimensions, I found this document, outlining only the memory and situation examples that indicate the following two possibilities:

    typedef struct {}
    dimSizes [measures]
    ArrDatatype data [1];
    } Array * ArrayHdl;

    or this one:

    typedef struct {}
    dimSize1 of Int32;
    .
    .
    .
    .
    dimSizeX of Int32;
    ArrDatatype data [1];
    } Array * ArrayHdl;

    They are equivalent, except that the int32 has been forgotten in the first!

    And a comma in the declaration of type for both!

    Personally, I tend to use the other, but never did more 2D pictures. For multi-D arrays, the first can be interesting if you get to make a loop on the dimensions of the matrix somehow.

  • results of math processor load

    We have problems to get the results of math (in this case, the matrix multiplication) which differ based on the processor intel used. We saw the differences between the core 2 duo T7700, Xeon X 5460 with a Pentium 4 Xeon based. The operating system does not make the difference (we tried XP x 32, XP x 64, x 64 Vista and windows 7 x 64).

    See also the source code with an executable here:

    http://www.boschjes.com/LV2009ISSUE

    We have implemented our own matrix multiplication (10 x slower) and it gave the same results on all platform (OS / CPU) combinations.

    Anyone have similar problems? And you saw him around mathematics? As we only studied the function of matrix multiplication.

    These tests were performed using labview 2009, f2. We are still looking at comparison with labview 7.1.1 and labview 8.6.1 tests.

    Someone at - it ideas?

    Oskar

    Hi Oskar,

    LabVIEW 2009 SP1 still uses MKL 10.1 because we find some other problems with 10.2 MKL.  If LabVIEW 2009 SP1 does not resolve it.

    On http://software.intel.com/en-us/intel-mkl, there is an option to evaluate.   You can download the evaluation version of MKL for 30 days usage.

    I have create a revised matrix multiply VI which divides the matrix has submatrices and multiplies B block.

    I hope this might solve your problem.  Could you please test it on your PC Xeon X 5460?

    Best regards
    Michael

  • Matrix inversion complex on FPGA

    Hello

    I implement a simple code on SMU-7966R. I need a function that calculates the inversion of a complex matrix (fixed-point). I was wondering if there is an existing library that provides the service or I must apply myself.

    Please can someone enlighten me?

    Thank you.

    I don't quite know librares for the execution of complex matrix inversion.

    There are two ways I used for the development of own implenetations. Both methods involve the decomposition of the matrix A through rotation matricies.

    (1) the QR decomposition through Givens rotations where is QR. This method breaks down the matrix in a unitary matrix Q and a upper triangular matrix R. The inverse of Q is simply its transposed to Hermetian because it is unitary. The inverse of R can be solved for by back substitution. Multiplying the inverse of Q and R gives the inverse of a.

    (2) use the signular A value decompositon to get two unit matricies u and V and a diagonal matrix S of the signular components. Again, reversing the unitary matricies is simply the transposed to Hermetian. The inverse of the diagonal nmatrix is only taking the reciprocal of the diagonal elements. The SWINE vesicular disease can be performed using an algorithm called the cyclic Jacobi method. This method is slightly more complicated than the QR decomposition since it requires an additional rotation matrix, but it avoids the back problems through substition.

    These two processes are iterative and converge to the exact solution as the number if iterations increases. While math can seem a little daunting at first, there is a lot of literature on these topics including different FPGA implementations. Just google 'FPGA QR Décomposition' or 'Method of FPGA Jacobi'.

  • Leaking handles when calling C API Via "Call library function" (example attached)

    Hi all

    Thank you for any assistance you can give. I am a pretty good C programmer and a mediocre programmer LabVIEW so keep that in mind. I created a VI and C simple API to illustrate the issue (all sources included, built with Visual Studio 2005)

    I drove a DLL of the C API with LabVIEW as you can probably guess. There is a delicate part of the C API which requires some pointer math to work. This is the part that is leaking handles (seen in the Task Manager, below. Handles over 2 million and growing). The leak is only seen in LabVIEW and not when you call my API directly from C code (the code for the example C example is also attached)

    )

    The VI that illustrates the problem is quite simple.

    LabVIEW moves of the buffer returned by "card Seq Blk Rd.vi' autour and causing 'Card Seq find Next429Ex.vi' to fail. It's my first clue that something is wrong - I think not that my buffer must move each time. I have to actually do some pointer math in my real API to fix this, but did not bother with this example. The question is the same regardless of the fix - up.

    The attached zip contains my example VI, and C for the API Source code and an example of C using the API (which does not leak handles).

    I'm sure I'm not enter a relatively simple concept LabVIEW memory management here, but still a mediocre time so be nice.

    Regards and thanks in advance.

    Brad


  • Help: "Intel Matrix Storage Manager for Windows XP" Installation failed

    First of all, has anyone successfully lowered their vista to xp in a machine SL400/SL500?

    I had just followed the "Windows XP clean installation/Downgrade Guide" here:

    http://Forum.NotebookReview.com/showthread.php?t=188992

    and got stuck in step "Install Intel Matrix Storage Manager for Windows XP"

    The 'Intel Matrix Storage Manager for Windows XP"for SL400/SL500 (Note: this driver is different from T/R61) I downloaded the support of lenovo cannot be installed. Every time when I followed the instructions of the official support page to run 2ksetup.exe, he gave me a saying invite "installation failed." I have also tried to run "2ksetup.exe" and "2ksetup.ini", according to the official support for unattended Setup page and nothing was (apparently it doesn't have too).

    PS: this installation is done after that the chipset intel is installed as indicated on page 'guide' from notebookreview.

    I also tried to use the driver for T/R 61, since in the official support page, it seems compatible. The installation can be performed successfully, but when I switch the 'compatibility' to 'AHCI' SATA drive in the bios, I can't start windows (every time it showed a blue screen and restarts automatically). When I went back, everything became normal.

    Someone has any idea how to handle this?

    Clean XP install on my SL400 worked like a breeze. Actually a little felt uncomfortable having a complete set of official XP drivers available, because my previous installation was on a HP with almost no XP support beyond what users were mosaicked together in forums.

    I don't like the idea of changing the setting in the BIOS SATA back and back, then I slipstreamed driver ICH9M AHCI (with SP3) by using the MSFN guide. After that, XP installs without complaining, and it was just a matter of download and to install the drivers using the wire of notebookreview.com as a checklist on what to install and in what order.

    Some information on the Guide from notebookreview:

    • I installed the Intel Matrix Storage Manager normally; didn't need to follow the instructions in the guide. Probably does not need to install at all, but you get the utility so you can check NCQ etc. works.
    • ACPI power management is named ThinkPad Power Management driver in the list of drivers for SL.
    • If integrate you the SP3, you will have already sound driver UAA, so you can skip that.
    • Skip Atmel TPM (Trusted Platform Module). There is no driver for the SL series.
  • Math function round() makes invisible label...

    I have a ranking application that figures on a percentage of an assignment and displays a side.

    with gold update, the label no longer appears when I run the application.

    Label {
                    id: findGrade
                    // custom property to calculate final grade percentage
                    text: "Percent: " + round(grdCalc.text * 100) / 100 + "%"
                    textStyle.fontWeight: FontWeight.Bold
                    enabled: true
                    visible: true
    
                }
    

    I also tried of Math.round, but it doesn't seem to work. I need to import a library of bb to make this work?

    If so, how can I find out what libraries can I include in a project. is it all just

    import bb.math 1.0?

    It must be Math.round (). I have not tried your code and can not at the present time, but try to put parentheses around all the math... "Percent:" + (Math.round(grdCalc.text * 100) / 100) + "%" ""

    Also conceivable that you'll have to do something with grdCalc.text. parseInt (grdCalc.text) or parseFloat(). Actually, I forgot how JavaScript will handle this entry otherwise.

  • Cannot reverse engineer Director math algorithm (myCalculation = 1 &amp; myFinalNumber * 6727714)

    I am rewriting several old movies of Director in modern software, but have met a roadblock trying to rewrite different algorithms because the math to the Director is not making any sense.

    The problem with this line:

    myCalculation =1& myFinalNumber *6727714


    For example, when myFinalNumber = 1258, I expect that myCalculation will result in "18463464212", but instead, it comes out as "1-126470380". I look at the expression myFinalNumber * 6727714 watch the result 126470380.

    How can we multiply the two numbers positive result in a negative response?


    I tried to work backwards to see if it there is no consistency in the results and have not been able to find a model of what math that it actually performs when it is supposed to solve 1258 * 6727714.


    I tried to separate the line into several lines, thinking maybe the string concatenation is making things, but there is no change by myFinalNumber * 6727714 and the concatenation then the front 1.


    Is there something stupidly obvious, that I don't see here? There is surely a sort of rhyme and reason how Director handles like that mathematical equations.


    Any ideas would be appreciated.



    There are limits to the size of an integer that Director can represent. More precisely:

    put the maxinteger

    2147483647

    If you add 1 to the maximum integer that the Director may represent the value will roll the largest negative number that the Director can represent.

    put the maxinteger + 1

    -2147483648

    If you need work with numbers greater than 2 billion then you will need to use floating-point numbers. In your case:

    put 1258 * 6727714.0

    8463464212.0000

  • VCenter 5.5 U1 can handle 5.0 ESXi hosts?

    According to VMware interoperability Guide, resembles vCenter 5.5 U1 can handle single host 5.5U1.

    It is a major problem for me. I just opened a folder with VMware, but can anyone confirm this?

    Thank you

    It seems that the matrix has been updated today and shows the compatibility for ESXi 4.0 or newer for vCenter Server 5.5 Update 1. What is important about vSAN, is that ESXi hosts have run the version 5.5 Update 1. The vSAN included in the GA 5.5 version was beta.

    André

  • Move the handles of direction in synchronization with the anchor point?

    Hi all

    I'm trying to move the anchor points on a random object (to get an informal aspect). (I know that some effects that already.)

    Maintenance of corner points is no problem - you just put the handles of direction to the same coordinates as their anchor.

    But I can't move an inflection point in the way I want it, which is to move the anchor point, but maintain the direction handles in exactly the same relation to their anchor as they did before. That is to say, they should remain smooth points.

    My script calculates the difference between the 'before' and 'after' the position of the anchor and applies this difference for the handles of direction... but in practice, the smooth points are converted at the corners, because the direction handles does not maintain their relationship with the anchor point.

    Would appreciate if someone can point out the flaw (s!) in my logic.

    var docRef = activeDocument;

    var activeDocument.selection.length = objects;

    var prompt = cShift ("Point change (pt)", 5 ");

    loop through all objects

    for (var count = 0; count < objects; count ++)

    {

    currentObj = activeDocument.selection [count];

    Nudge (currentObj);

    }

    function Wizz each object

    function nudge (obj)

    {

    var objPoints = obj.selectedPathPoints;

    var objPointCount = objPoints.length;

    for (var i = 0; i < objPointCount; i ++) {}

    var thisPoint = objPoints [i];

    var go = thisPoint.anchor [0];

    var vb = thisPoint.anchor [1];

    var = thisPoint.leftDirection [0];

    var lb = thisPoint.leftDirection [1];

    RA var = thisPoint.rightDirection [0];

    var rb = thisPoint.rightDirection [1];

    If (goes == the & & will == ra & & vb == lbs & & vb == rb)

    {/ / If the point corner, alternate the position of anchor}

    go = go + ((Math.random () * cShift));

    VB = vb + ((Math.random () * cShift));

    thisPoint.anchor = Array (va, vb);

    handles direction all at the same position, now a corner point

    thisPoint.leftDirection = Array (va, vb);

    thisPoint.rightDirection = Array (va, vb);

    }

    on the other

    {/ / not a corner point: keep handles in the same position relative to their offbeat anchor}

    var = va2 will + ((Math.random () * cShift));

    vB2 var = vb + ((Math.random () * cShift));

    thisPoint.anchor = Array (va2, vb2);

    This bit calculates random offset applied to the anchor

    var anchorShifta = va2 - going;

    var anchorShiftb = vb2 - vb;

    These lines apply the same quarters for direction handles

    thisPoint.leftDirection [0] = la + anchorShifta;

    thisPoint.leftDirection [1] = lb + anchorShiftb;

    thisPoint.rightDirection [0] = ra + anchorShifta;

    thisPoint.rightDirection [1] = BO + anchorShiftb;

    }}}

    Modification of the other part:

    else
    { // not a corner point: keep handles in same relative position to their shifted anchor
        var aShift = Math.random()*cShift;
        var bShift = Math.random()*cShift;
        thisPoint.anchor = [va  + aShift, vb + bShift];
        thisPoint.leftDirection = [la + aShift, lb + bShift];
        thisPoint.rightDirection = [ra + aShift, rb + bShift];
    }
    
  • Rotate the matrix of the position of the mouse.

    Hey guys I've been banging my head against this problem for a few hours.  I have a rectangle object created, I want that the rotation of the rectangle following my mouse cursor. (I am easily able to do).  Where things become difficult, is that I want the rectangle to turn around its lower right, for this I found that I need to use a transformation matrix.  At this point, I am able to have my rectangle revolve around the bottom to the right of point, but I can not understand how to follow my mouse cursor as well during rotation.  The reason being that with a matrix you can only say to him a quantity of radians to rotate (matrix.rotate) rather than only being able to define his current rotation... Here is my code

    point: var Point = new Point (myRectangle.x+myRectangle.width/2, myRectangle.y+myRectangle.height/2);

    function rotateObject (event: Event): void

    {

    var m:Matrix = myRectangle.transform.matrix;

    m.TX = point.x;

    m.Ty = point.y;

    m.Rotate (45 *(Math.PI/180));

    m.TX += point.x;

    m.Ty += point.y;

    myRectangle.transform.matrix = m;

    }

    addEventListener (Event.ENTER_FRAME, rotateObject);

    So with the current code, it runs constantly in the lower right, I have tried to change the '45' to ' Math.atan (mouseX/mouseY), but there again, it seems that only works if I could set the rotation of the matrix which, rather than say how things to spin to...»

    Any thoughts or ideas would be appreciated, thanks!

    Sure... Create a new AS3 document, paste this into frame 1, run:

    import flash.geom.Rectangle;

    import flash.display.Sprite;

    import flash.events.Event;

    container, I use graphs and draw

    directly to this

    var container: Sprite = new Sprite();

    addChild (container);

    draw the rectangle, pushing upward on the axis y

    container.graphics.beginFill(0xFF0000,1);

    container.graphics.drawRect (0, -100, 100, 100); See the-100 on the y-axis?

    container.graphics.endFill ();

    Place it in the center of the stage

    Container.x = stage.stageWidth / 2;

    Container.y = stage.stageHeight / 2;

    start shooting baby

    addEventListener (Event.ENTER_FRAME, rotateMeBaby);

    function rotateMeBaby(e:Event):void

    {

    Container.rotation += 3;

    }

Maybe you are looking for