Learning Co-ordinate System - Problem

Hi
I created a sample project to epxlain my problem.
There are two canvases in the main application. outerspace canvas and innerspace canvas.
innerspace canvas has a visual component "mainBox"
and there is also a visual component in outerspace canvas named "overBox"
now i want user to map the x-xis and y-xis of overBox to mainBox, so when user will click re-arrange, overbox will completely cover the mainBox.
This is actually a problem of different co-oridatane systems and i dont know how to map them into one.
Here is the code.
Application File
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:ns1="*">
     <mx:Script>
          <![CDATA[
                    private function arrange(event:MouseEvent):void{
                         var point:Point = mainBox.localToGlobal(new Point());
                         overBox.x = point.x;
                         overBox.y = point.y;
          ]]>
     </mx:Script>
     <mx:Canvas width="80%" height="80%" horizontalCenter="0" verticalCenter="0" id="outerSpace" backgroundColor="#A9A9A9">
          <mx:Canvas width="80%" height="80%" horizontalCenter="0" verticalCenter="0" id="innerSpace" backgroundColor="#8DB5FF">
               <ns1:Node horizontalCenter="0" verticalCenter="0" width="100" height="100" id="mainBox">
               </ns1:Node>
          </mx:Canvas>
          <ns1:Node x="21" y="10" id="overBox" width="100" height="100" backgroundColor="#FFA352">
          </ns1:Node>
     </mx:Canvas>
     <mx:Button label="Re-Arrange" click="arrange(event)" left="10" top="10"/>
</mx:Application>
Project is also attached.
Thanks

Just see below. But it won't work if you resize the view, as one is centered
private
function arrange(event:MouseEvent):void
// Get mainbox coord in local system - i.e. relative to innerSpace
var p1:Point = new Point(mainBox.x,mainBox.y); 
// Convert it to global coord from innerSpace
var p2:Point = innerSpace.localToGlobal(p1); 
// Convert it to local coord - relative to outerSpace
var p3:Point = outerSpace.globalToLocal(p2); 
overBox.x=p3.x;
overBox.y=p3.y;

Similar Messages

  • PageItem Co-ordinate w.r.t. Spread Co-ordinate System

    Hi All,<br /><br />I am trying to get coordinates of text frame with respect to spread co-ordinate system.<br />I have used following code for this:<br /><br />InterfacePtr<IGeometry> frameGeometry(textFrame, IID_IGEOMETRY);<br />PMRect frmRect = frameGeometry->GetPathBoundingBox();<br />::InnerToParent(textFrame, &frmRect);<br /><br />Here textFrame is the ITextFrame pointer of which I want to get coordiantes w.r.t. Spread. The problem is dimensions in frmRect doesnot change even after transformation using InnerToParent().<br /><br />Can anyone suggest me in this regard, where I am wrong?<br /><br />- Pete

    Hi Pete,
    I think your problem is that the parent of kMultiColumnItemBoss or kFrameItemBoss (the only bosses that could store the ITextFrame interface you start from) is kSplineItemBoss and not kSpreadBoss. With your call to TransformUtils::InnerToParent you are likely getting the coords in the spline item's coordinate space and not in the spread's one. The SDK documentation specifies that "The parent coordinate space is the first ancestor boss object on IHierarchy that has an IGeometry interface".
    HTH,
    Emanuele.

  • Drawing quadratic equations on a 2D cartesian co-ordinate system

    Hi,
    I need to design a 2D cartesian co-ordinate system to plot quadratic equations on the graph using pure action script. Quadratic equations are of the form y = ax^2 + bx + c where a,b and c are the variables for which the values need to accepted from the user as input. Accordingly, the curve needs to be plotted on the graph.
    Could anybody kindly help me to write an action script 3.0 code to suffice the above requirement?
    Thanks in advance.
    Cheers,
    Pratik.

    that will take more work than doable in a forum.  to start, you need to find the roots of your equation (use the quadratic formula) and make sure the real roots are towards the center of your x-axis.  the two parts where y tends towards (+infinity or -infinity) do not require much display.
    if there is only 1 or 0 roots, put that equation in vertex form and use an x-axis centered around the vertex.
    for a sample of how this can be done:  http://www.kglad.com > snippets > function graphs.

  • AWT co-ordinate system

    Hello.
    I still can't figure out. I'm plotting graph co-ordinates on an AWT Canvas component. i.e (x,y) values
    However, due to the AWT co-ordinate system, the origin (0,0) is at the top left hand corner of the screen.
    What trick can I do to plot my points with
    respect to the origin at the BOTTOM left hand corner of the canvas?
    I am using the fillOval() method to display the points on the canvas. (See code below)
    All I want to do is reverse the direction
    of the y axis. Some sample code would be very much appreciated.
    A.
    My paint code is as follows ...
    <code>
    public void paint(Graphics g)
    // Paint the means
    g.clearRect(0, 0, 600, 500);
              if (firststep)
              db.paint(g);
    else
    for(int i = 0; i < nk; i++) {
    g.setColor(cl);                                        
    Point p = (Point) means.elementAt(i);
    //           System.out.println("mean = "+p);
                                            g.fillOval( (int) (p.xVal()*600)-PtSize/2, (int) (p.yVal()*500)-PtSize/2, PtSize, PtSize);                    //      Draw an oval
                             String s = "k= "+ i+ "[" + round(p.x, 2) + " , "+ round(p.y, 2) + "]" ;
                             g.drawString(s, (int) (p.xVal()*600)-PtSize/2 + 10 , (int) (p.yVal()*500)-PtSize/2 + 15 );
    // Print the cluster
    Vector cluster = (Vector) clusters.elementAt(i);
    int size = cluster.size();
    for (int j = 0; j < size ; j++ )
              p = (Point) cluster.elementAt(j);
    //     g.setColor(Color.green);
    //     g.fillRect( (int) (p.xVal()*600)-PtSize/4,(int) (p.yVal()*500)-PtSize/4,PtSize/2,PtSize/2);
    //     g.setColor(cl[i]);
                                            g.fillOval( (int) (p.xVal()*600)-PtSize/4, (int) (p.yVal()*500) -PtSize/4,PtSize/2,PtSize/2);               //      Draw circles to represent the points                
    //          g.drawString(i+"",(int)p.xVal(), (int)p.yVal());
    }</code>

    An example without axises or labels:import java.awt.*;
    import javax.swing.*;
    public class Test extends JFrame {
        public Test () {
            setContentPane (new GraphPanel ());
            setDefaultCloseOperation (EXIT_ON_CLOSE);
            setTitle ("Graph example");
            pack ();
            setLocationRelativeTo (null);
            show ();
        public class GraphPanel extends JPanel {
            public void paintComponent (Graphics graphics) {
                super.paintComponent (graphics);
                // y = x^2
                Point previousPoint = null;
                for (int x = 0; x <= getWidth () / 10; x ++) {
                    int y = x * x;
                    Point point = new Point (x * 10, getHeight () - y);
                    if (previousPoint != null) {
                        graphics.drawLine (previousPoint.x, previousPoint.y, point.x, point.y);
                    previousPoint = point;
            public Dimension getPreferredSize () {
                return new Dimension (200, 400);
        public static void main (String[] parameters) {
            new Test ();
    }Kind regards,
      Levi

  • Georeference cartesian co-ordinates to standard co-ordinate system

    We have set of old maps which do not follow any standard co-ordinate system and they are just cartesian grid co-ordinates (for example lat,long 40.733828,-73.988414 corresponds to cartesian co-ordinates 1610350, 1114450) . I want to explore a possibility of applying simple transformation and geo-reference it to standard co-ordinate system. I can have little compromise on positional accuracy. What is best available method to do it oracle spatial?
    Thanks

    Well...
    One approach would be via EPSG method 9621. Unfortunately, 9621 is not yet implemented, at this point.
    Another approach is via NADCON, although NADCON was not semantically meant to be used in this way. If you can determine (lat, lon) and (x,y) exactly along the 4 corners of your unknown map, we could use the NADCON method. It is difficult to say how much accuracy you would get with these 4 points. The accuracy would increase with an equi-spaced grid of n x m known points.
    Yet another approach would be that we simply assume a transverse mercator projection. Since your map only covers Manhattan - who will see the difference between transverse mercator or anything else (assuming that the projection center is near Manhattan)? But it is a little more complex, of course. First, we would need to perform a datum transformation with the required rotation. This would simulate the rotation of the map you talked about. Then we would perform a transverse mercator projection with its center near Manhattan. We would have to assume that your unknown projection also had its center near Manhattan (resulting in minimal distortion, there). This assumption is reasonable for a map of this scale.
    If you give me approximately 5 points for which you know lat/lon and x/y, I will see what I can do. Usually, we do not do this, and it will certainly take a few days, for I will have to fit it into my schedule.
    Also, a reasonable result will only come out if our assumptions regarding this unknown projection are mostly true.

  • Support for Co-ordinate system?

    Does anyone know whether Oracle Spatial supports the mapping co-ordinate system used in Romania (Stereo70)?

    Yes, this SRID is based on the EPSG projection method 9809 ("Oblique Stereographic"). If you are not sure whether this is the SRID you need, do you also have some numeric parameters?
    SQL> select wktext from cs_srs where srid = 31700;
    WKTEXT
    PROJCS["Dealul Piscului 1970/ Stereo 70", GEOGCS [ "Dealul Piscului 1970", DATUM
    ["Dealul Piscului 1970 (EPSG ID 6317)", SPHEROID ["Krassowsky 1940 (EPSG ID 702
    4)", 6378245, 298.3]], PRIMEM [ "Greenwich", 0.000000 ], UNIT ["Decimal Degree",
    0.01745329251994328]], PROJECTION ["Stereo 70 (EPSG OP 19926)"], UNIT ["Meter",
    1]]
    SQL>
    By the way: the WKT is relatively short, and does not contain projection parameters. This is because the 9809 method is not mapped to a legacy projection, and thus the legacy parameters for this projection are not available. The EPSG parameters are in the SDO_COORD_OP_PARAM_VALS table.

  • Interactive X-Y Co-ordinate system

    Hi
    Actually I want to have an Interactive x-y Co-ordinate system(having adjustable grid) where I can place arcs and lines at specified angles and position. Along with that we can also can fill out each grid cell with some value.
    Is that much interaction is possible with LabVIEW. Please help me out.
    Regards
    Gaurav Sharma

    Use this javascript:
    var mouseX = 0;
    var mouseY = 0;
    function mouseXY(e) {
       if (IE) {
          mouseX = event.clientX + document.body.scrollLeft
          mouseY = event.clientY + document.body.scrollTop
       } else {
          mouseX = e.pageX;
          mouseY = e.pageY;
    // set up mouse movement capture for tool tip placement
    var IE = document.all?true:false
    document.onmousemove=mouseXY;Then just use mouseX and mouseY wherever you want to find out the current mouse position.

  • System copy on target system problem

    Dear All
    Please help me
    I system copy on targer system problem (Java Migration Tool Kit) and debug with SAP NOTE 1119190 but I can't find jmt.jar.
    This is log runJmt.log
    java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.sap.engine.offline.OfflineToolStart.main(OfflineToolStart.java:81)
    Caused by: java.lang.NoClassDefFoundError: com/sap/sdt/util/vers/VersionException
         at com.sap.sdt.jmt.migrationtool.MigrationToolImport.createVersion(MigrationToolImport.java:984)
         at com.sap.sdt.jmt.migrationtool.MigrationToolImport.startTool(MigrationToolImport.java:172)
         at com.sap.sdt.jmt.migrationtool.MigrationToolImport.main(MigrationToolImport.java:1062)
         ... 5 more
    Thanks

    Dear All
    Please help me
    I system copy on targer system problem (Java Migration Tool Kit) and debug with SAP NOTE 1119190 but I can't find jmt.jar.
    This is log runJmt.log
    java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.sap.engine.offline.OfflineToolStart.main(OfflineToolStart.java:81)
    Caused by: java.lang.NoClassDefFoundError: com/sap/sdt/util/vers/VersionException
         at com.sap.sdt.jmt.migrationtool.MigrationToolImport.createVersion(MigrationToolImport.java:984)
         at com.sap.sdt.jmt.migrationtool.MigrationToolImport.startTool(MigrationToolImport.java:172)
         at com.sap.sdt.jmt.migrationtool.MigrationToolImport.main(MigrationToolImport.java:1062)
         ... 5 more
    Thanks

  • Run filters on folder - 4.7.0 Temporary System Problem

    When I try to run filters on folder to clean up my inbox into my folders I am getting this message -
    An (SMTP) error occurred while sending mail. The server responded: 4.7.0 Temporary System Problem. Try again later (WS). t6sm1646118qai.10 - gsmtp.
    How can I fix this, my inbox is horrifying!
    Filters do work on start up, but only if I haven't opened them via mobile. And I can create and sort new filters.

    That sounds like your using filters to send mail. If you sending lots of mail gmail will simply stop sending as your outside the terms of use. Hence the temporary nature of the error.

  • What's with the new edition of Pages using Maverick?  Google rejects the files  with the following message attached "The reason for the problem: 5.3.0 - Other mail system problem 552-'5.7.0 This message was blocked as its content security threat?

    I recently upgraded both Pages 09 (I believe) and went to OSX 10.9 Maverick .... now I am unable to send a pages document to a friend on gmail.  Google rejects the message and attachment with the following explanation -
    The reason for the problem:
    5.3.0 - Other mail system problem 552-'5.7.0 This message was blocked because its content presents a potential\n5.7.0 security issue.

    Same Problem here
    IWORKS 09    pages, keynote, numbers does not send in MAIL (mac) because of "This message was blocked because its content presents a potentialsecurity issue"
    its a problem not only on GMAIL but also Live, Hotmail, Yahoo, and other services...
    The problem is that gmail and others haved yet accepted the latest iworks 09 files. its a problem that apple can ask then to fix but its up to the gmail and others to fix it.
    Solution!!!:
    1 - Send it by exporting to office files
    2 - Saving the files as old iwork documents
    3 - Command P and save as PDF
    4 - Save in icloud and send the URL
    So you can still send them but have to take a bit more of your time
    i hope you understand my english is not optimal
    And if you have any questions feel free to ask me

  • Serious System Problems. Pictures and Documents folders are opening iPhoto when clicked. iPhoto Library gone.

    I have been speaking to Old Toad for the majority of today trying to fix my iPhoto Library as its become corrupt and I cannot get my photos/videos back into iPhoto. After many many suggestions I seem to have created some serious system problems.
    PLEASE READ ALL OF THIS THREAD...
    https://discussions.apple.com/message/21742033#21742033
    If anybody can be of assisatance that would be a great help.
    I am a mac dummie, recently transfered so foolproof guidance will be helpfull!
    (Unfortunatly.. and now I know the importance, I haven't used time-machine and my mac isn't backed up. If i restore to factory settings I will loose the 600+ photos and videos I had in my iPhoto Library.... which dissapeared, which is the whole reason why I created the first thread)
    Thank you!!

    Linc:
    It appeared to me that somehow the OP's Picture folder was converted into an iPhoto Library as his screenshot of the PIctures folder looked like the inside of a library.
    This statement by the OP make me think it might be more than just an iPhoto issue (the bold text):
    I am unable to drag the Picture folder to the desktop, It wont move, and iPhoto (which is still empty) just opens.
    Some how the same is happening with Documents,
    OT

  • System problems (all new hardware)

    well as the subject says i have system problems, let me explain in details.
    this happened yesterday, when i use the computer (moving the mouse arround) the computer is fine and works as it should CPU, GPU and so on is fine and normal in usage and temp but as soon as i let go of the mouse and wait arround 2 min, all my 8 cores (i7 3.5Ghz) goes 100% and GPU goes 100% with 70C ++ temp and the fans starts running crazy.... but as soon as i start moving my mouse arround again everything goes back to normal :S
    and this affects movies i watch and games, making it lagg like crazy :S
    i have NEVER EVER EVER in my life encounter such a strange error / fault whatever it is :S i have tryed unplugging my mouse, still encounter the problem, tryed installing GPU driver again (fresh install), tryed rolling back GPU driver, but that didnt work.... as i figured out that my entire system was overloading when i wasnt "using" the computer (moving the mouse arround) :S
    and just to be clear, all hardware is BRAND NEW!!!! motherboard, cpu, memory, watercooling system (CPU)..... and they worked fine uptill yesterday :S (strangly enough right after i installed Need For Speed Most Wanted 2012) :S but i dont think that has ANYTHING to do with this "error"...
    i could also mention that when i have "Task Manager" up this error doesnt happen (with the 100% on all 8 cores and GPU getting 70C and so on)....
    REALY need some help here!!!?

    Quote
    MEM: 2 x 2Gb A-DATA Tech DDR3-1333Mhz | 2 x 8Gb Kingston DDR3-1333Mhz
    Are you mixing these two kits? bad idea, try with just one kit at a time.
    Quote
    OC: CPU @ 4.2Ghz 77W
    Remove any oc, to be safe: >>Clear CMOS Guide<<

  • System problems? Neither my iPhone nor my wife's is able to make calls. Rebooted, restored, etc. Is Verizon experiencing problems?

    System problems? Neither my iPhone nor my wife's is able to make calls. Rebooted, restored, etc. Is Verizon experiencing problems?

    Probably , it's a big country , if you tell your general location a user in that area might be able to confirm your problem an an outage

  • CCMS Error - There are system problems on the remote host (system failure)

    Hi,
    I have installed the SAPCCMSR agent in the AccAD(Accelerated Application Delivery) server. However, when I execute OS07 and try to view the CPU usage, I encountered this error:
    There are system problems on the remote host (system failure)
    Message no. S1308
    Any idea what does the error mean?
    Thanks.
    KY

    Hi,
    Thanks for replying. The problem has been resolved after upgrading the sapccmsr.
    Thanks.
    Regards,
    KY

  • Espn2-ios6-get system problem, try again later error-why

    I tried to get the ESPN app to work yesterday. i was asked to provide my Time Warner name and ID. After providing the information, I got a system problem error. Is this a iOS6 problem? Has anyone else run into this?

    Hi,
    first: please avoid cross postings. You've posted exactly the same here: {message:id=10652291}
    Second: Why do you think this is an APEX Listener related issue? Do you actually use APEX Listener to access your APEX instance?
    "System Unavailable. Please try again later."Which system is throwing that error? It could be an application server (e.g. GlassFish) you've deployed APEX Listener to. If so, the log file to search would be the one of your application server...
    Please decide which of the two threads you want to follow. Either way, provide some additional information on your scenario... Just the APEX version isn't enough to answer your questions...
    -Udo

Maybe you are looking for