How to determine the coordinates of the point?

I've achieved assignment 3 for CS193p course of Stanford, Fall 2011. The assignment basically asks to make a graph of points of an equation of something like X + 2, X is the X axis, and X + 2 (which is the result of the equation) is the Y axis.
The problem is that it gives an already made class which draws axes, hashmarks and so. The lecturer describes how it works in a commented paragraph in the .h file of the drawer, I still can't understand though how can I count the number of points between the origin and the hashmark, then convert it to pixels and iterate over it. The hard part of it is getting the hashmark position, or in other words, knowing where to put X and where to put Y according to the current scale.
A subtask is to make a zoom in and zoom out buttons, and I've already done that by the way.
You can download everything from here.
The axes drawer class: AxesDrawer.zip
The assignment PDF: Assignment 3.pdf
My project: Assignment 3.zip
Any help is appreciated.

Can someone help please?

Similar Messages

  • DETECT THE BOUNDARY OBTAIN THE COORDINATE OF ALL POINTS IN THE BOUNDARY

    HI EVERY BODY, HAPPY NEW YEAR,,,,,
    I AM RECENTLY USE LABVIEW 9.0 IN ORDER TO CREATE  A PROGRAM THROUGH WHICH I CAN OBTAIN PARTICLE CHARACTERISTICS ( RADIUS, CENTER, LOCAL GRAY LEVEL, MINIMUM GRAY LEVEL), BUT NOW I AM FACING A PROBLEM THAT WHILE I AM TRACKING THE BOUNDARY OF THE PARTICLES IN THE THRESHOLD IMAGE, THE PROGRAM GIVE ME A 2D ARRAY CONTAINS ALL VALUES OF THE BOUNDARY OF ALL PARTICLES,. UNFORTUNATELY I CAN NOT TO DETERMINE THE COORDINATE OF EACH POINT IN THE BOUNDARY.
    SO, HOW CAN I OBTAINED POSITION OF EVERY VALUE IN THE BOUNDARY....
    THANKS FOR YOUR HELP

    2D ARRAY CONTAINS THE VALUES OF THE PARTICLE BOUNDARY...........

  • Hello  I just buy a iphone 5C of opportunity for united state (I live in France), but iCloud is block and I don t have the coordinates of the former owner.  how can I do?

    hello
    I just buy a iphone 5C of opportunity for united state (I live in France), but iCloud is block and I don t have the coordinates of the former owner.
    how can I do?

    The iPhone is Activation Locked. Without the AppleID and password of the original owner the iPhone is useless. Ask for a refund.

  • How do I get the coordinates of the text block (TextFrame) help me please!

    Dim myApp As New Illustrator.Application
    Dim myDoc As Illustrator.Document
    myDoc = myApp.ActiveDocument
    Dim textRef = myDoc.TextFrames.Add
    For Each ArtPageItems In myDoc.PageItems
    If TypeName(ArtPageItems) = "TextFrame" Then
    '========It is necessary to obtain the coordinates of the text block and move closer to the object (ie the text)============
    Else
    End If
    Next

    Hi Todd, you're welcome, please explain better, I don't understand the question.
    are you trying to "move" a textframe (Dim textRef = myDoc.TextFrames.Add) closer to other text frames? or do you want to "zoom" to this textframe?

  • A script that captures the coordinates of the mouse clicks and saves them into a file

    Hello,
    I'm trying to create a cartoon taking a movie (I've chosen blade runner) as base. I've got the real movie and I've exported all the pictures using VirtualDUB. Now I have a lot of images to modify. I would like to modify the actors faces with the faces generated by Facegen modeller. I'm thinking how to make the whole process automatic because I have a lot of images to manage. I've chosen to use Automate BPA,because it seems the best for this matter. I'm a newbie,so this is my first attempt using Adobe Photoshop and Automate BPA. I wrote a little script. It takes a face generated with Facegen modeller and tries to put it above the original actors faces. But it doesn't work very good and I'm not really satisfied,because the process is not fully automated. To save some time I need to write a script that captures the coordinates of the mouse when I click over the faces and that saves them into a file,so that Automate BPA can read these coordinates from that file and can put the face generated with Facegen Modeller above the original face. I think that Automate BPA is not good for this matter. I think that two coordinates are enough,X and Y. They can be the coordinates of the nose,because it is always in the middle of every face. It is relevant to knows how big should be the layer of the new face,too. This is the Automate BPA code that I wrote :
    <AMVARIABLE NAME="nome_foto" TYPE="TEXT"></AMVARIABLE>
    <AMVARIABLE NAME="estensione_foto" TYPE="TEXT"></AMVARIABLE>
    <AMSET VARIABLENAME="nome_foto">br</AMSET>
    <AMSET VARIABLENAME="estensione_foto">.jpeg</AMSET>
    <AMVARIABLE NAME="numero_foto" TYPE="NUMBER"></AMVARIABLE>
    <AMVARIABLE NAME="coord_x" TYPE="NUMBER"></AMVARIABLE>
    <AMVARIABLE NAME="coord_y" TYPE="NUMBER"></AMVARIABLE>
    <AMWINDOWMINIMIZE WINDOWTITLE="Aggiungere_layer - AutoMate BPA Agent
    Task Builder" />
    <AMWINDOWMINIMIZE WINDOWTITLE="AutoMate BPA Server Management Console
    - localhost (Administrator)" AM_ONERROR="CONTINUE" />
    <AMENDPROCESS PROCESS="E:\Programmi_\Adobe Photoshop
    CS5\Photoshop.exe" AM_ONERROR="CONTINUE" />
    <AMRUN FILE="%&quot;E:\Programmi_\Adobe Photoshop CS5\Photoshop.exe&quot;%" />
    <AMPAUSE ACTION="waitfor" SCALAR="15" />
    <AMSENDKEY>{CTRL}o</AMSENDKEY>
    <AMPAUSE ACTION="waitfor" SCALAR="1" />
    <AMINPUTBOX RESULTVARIABLE="numero_foto">Inserire numero FOTO di
    partenza -1</AMINPUTBOX>
    <AMINCREMENTVARIABLE RESULTVARIABLE="numero_foto" />
    <AMPAUSE ACTION="waitfor" SCALAR="1" />
    <AMMOUSEMOVEOBJECT WINDOWTITLE="Apri" OBJECTNAME="%nome_foto &amp;
    numero_foto &amp; estensione_foto%" OBJECTCLASS="SysListView32"
    OBJECTTYPE="ListItem" CHECKOBJECTNAME="YES" CHECKOBJECTCLASS="YES"
    CHECKOBJECTTYPE="YES" />
    <AMMOUSECLICK CLICK="double" />
    <AMPAUSE ACTION="waitfor" SCALAR="10" />
    <AMSENDKEY>{CTRL}+</AMSENDKEY>
    <AMPAUSE ACTION="waitfor" SCALAR="20" />
    <AMSENDKEY>l</AMSENDKEY>
    <AMPAUSE ACTION="waitfor" SCALAR="2" />
    <AMMOUSEMOVE MOVEX="429" MOVEY="281" RELATIVETO="screen" />
    <AMMOUSECLICK />
    <AMPAUSE ACTION="waitfor" SCALAR="2" />
    <AMMOUSEMOVE MOVEX="659" MOVEY="281" RELATIVETO="screen" />
    <AMPAUSE ACTION="waitfor" SCALAR="2" />
    <AMMOUSECLICK />
    <AMPAUSE ACTION="waitfor" SCALAR="2" />
    <AMMOUSEMOVE MOVEX="659" MOVEY="546" RELATIVETO="screen" />
    <AMPAUSE ACTION="waitfor" SCALAR="2" />
    <AMMOUSECLICK />
    <AMPAUSE ACTION="waitfor" SCALAR="2" />
    <AMMOUSEMOVE MOVEX="429" MOVEY="546" RELATIVETO="screen" />
    <AMPAUSE ACTION="waitfor" SCALAR="2" />
    <AMMOUSECLICK />
    <AMPAUSE ACTION="waitfor" SCALAR="2" />
    <AMMOUSEMOVE MOVEX="429" MOVEY="281" RELATIVETO="screen" />
    <AMPAUSE ACTION="waitfor" SCALAR="2" />
    <AMMOUSECLICK />
    <AMPAUSE ACTION="waitfor" SCALAR="2" />
    <AMSENDKEY>v</AMSENDKEY>
    <AMPAUSE ACTION="waitfor" SCALAR="2" />
    <AMMOUSECLICK CLICK="hold_down" />
    <AMPAUSE ACTION="waitfor" SCALAR="2" />
    <AMMOUSEMOVE MOVEX="131" MOVEY="99" RELATIVETO="screen" />
    <AMPAUSE ACTION="waitfor" SCALAR="2" />
    <AMMOUSEMOVE MOVEX="99" MOVEY="162" RELATIVETO="screen" />
    <AMPAUSE ACTION="waitfor" SCALAR="2" />
    <AMMOUSECLICK CLICK="release" />
    <AMPAUSE ACTION="waitfor" SCALAR="2" />
    <AMINPUTBOX RESULTVARIABLE="coord_x">Inserire coordinata X</AMINPUTBOX>
    <AMINPUTBOX RESULTVARIABLE="coord_y">Inserire coordinata Y</AMINPUTBOX>
    <AMMOUSEMOVE MOVEX="200" MOVEY="200" RELATIVETO="screen" />
    <AMMOUSECLICK CLICK="hold_down" />
    <AMMOUSEMOVE MOVEX="%coord_x%" MOVEY="%coord_y%" RELATIVETO="position" />
    <AMMOUSECLICK />
    and this is a short video to explain better what I want to do :
    http://www.flickr.com/photos/26687972@N03/5331705934/
    In the last scene of the video you will see the script asking to input the X and the Y coordinates of the nose. This request is time consuming. For this reason I want to write a script that captures automatically the coordinates of the mouse clicks. The only thing to do should be click over the nose and the script should make the rest. As "c.pfaffenbichler" suggested here : http://forums.adobe.com/thread/775219, I could explore 3 ways :
    1) use the Color Sampler Tool’s input with a conventional Photoshop Script.
    2) use After Effects would provide a better solution.
    3) Photoshop’s Animation Panel might also offer some easier way as it might be possible to load two movies (or one movie and one image) and animate the one with the rendered head in relation to the other.
    Since I'm a totally newbie in graphic and animation,could you help me to explore these ways ? Thanks for your cooperation.

    These are the coordinates of the contours of the face that you see on the picture. Can you explain to me how they are calculated ? The coordinates of the first colums are intuitive,but I'm not able to understand how are calculated the coordinates of the second one.
    Thanks.
    1 COL     2 COL (how are calculated these values ?)
    307.5000 182.0000 m
    312.5000 192.0000 l
    321.5000 194.0000 l
    330.5000 193.0000 l
    335.0000 187.0000 l
    337.0000 180.5000 l
    340.0000 174.0000 l
    338.5000 165.5000 l
    336.0000 159.0000 l
    331.5000 153.0000 l
    324.5000 150.0000 l
    317.0000 154.0000 l
    312.5000 161.0000 l
    309.0000 173.0000 l
    307.5000 182.0000 l
    Message was edited by: LaoMar

  • The MDX function CURRENTMEMBER failed because the coordinate for the attribute contains a set

     
    How to handle this error: The MDX function CURRENTMEMBER failed because the coordinate for the attribute contains a set. when executing MDX query:
    SELECT (
    { [Measures].[Amount]}
    )ON COLUMNS,
    [OrganizationUnits].[Description].[Description].MEMBERS,
    [OrganizationUnits].[IsCURRENT].[IsCURRENT]
    ) ON ROWS
    FROM
    (SELECT [OrganizationUnits].[Description] ON 0
    FROM
    [CubeName]
    WHERE(
    {[OrganizationUnits].[Description].&[Unit1],[OrganizationUnits].[Description].&[Unit2]}
    Thanks!!

    Hi Arth81,
    Please try the query below.
    WITH MEMBER MEASURES.IsCURRENT AS [OrganizationUnits].[IsCURRENT].[IsCURRENT].CURRENTMEMBER.NAME
    SELECT
    { [Measures].[Amount],MEASURES.IsCURRENT} ON COLUMNS,
    {[OrganizationUnits].[Description].[Description].MEMBERS,
    } ON ROWS
    FROM
    (SELECT [OrganizationUnits].[Description].MEMBERS ON 0
    FROM
    [CubeName]
    WHERE(
    {[OrganizationUnits].[Description].&[Unit1],[OrganizationUnits].[Description].&[Unit2]}
    Regards,
    Charlie Liao
    TechNet Community Support

  • I want to know the coordinates of the mouse

    I want to know the coordinates of the mouse when the mouse is outside my application?

    Hi,
    No, it is not possible... In order for a MouseListener to know when the mouse exited a component, it first needs to know the position of the application's GUI on the screen and also position of the cursor on the screen.
    But in JDK 1.5 we have an option java.awt.MouseInfo.getPo..(); to get current mouse possition.
    regards
    Dhina

  • Find the coordinate of the transformation anchorpoint of a pageitem

    hi
    i developp an extension for indesign with CS extension builder 2 and flashbuilder 4.6 and i dont find the coordinate of the transformation anchorpoint of a pageitem. Where can i find this property ?
    thanks
    simon

    I moved this discussion to the scripting forum because it's not an SDK question.

  • How to determine client locale from the mail?

    How to determine client locale(language/country) from the mail(header)?
    I investigate that some mails have not got any content-language header...
    Also, If mail is in multipart , I cannot get it throught the contentType....
    e.g some header contain header like this: content-Type: "text/html; charset=Big5"
    but some are : content-Type: multipart/mixed; boundary......";
    So, how can I know the client locale?
    Thanks

    You should be able to get the charset from the content type, as u said. the reason some types don't have a charset, such as multipart/* types, is because they don't contain any content on their own! they only contain nested body parts, each of which should have a charset specified. you're gonna have to get the charset by following the mail structure recursively.

  • JSF: How to determine which element has the focus?

    Hi all,
    I have a JSP with some input fields and a text area. When I press "ENTER" the data I have entered should be saved. That works fine (I use JavaScript to catch the keyPressed-event). But when I want to insert a new line in the text area, I press ENTER too and this invokes the javascript function. So it�s not possible to insert a new line in the text area. And I don`t want to save the data when I�m just inserting a new line.
    is it possible to determine which element has the focus at the moment of pressing ENTER? if it`s the text area then I won�t save the data and inserting a new line is possible? Or how to say: "Insert an new line if the user presses SHIFT+ENTER" or something like that?
    I�m using JSC for my application and this is my JS-function:
    function checkIt(evt)      
    var charCode = (evt.charCode) ? evt.charCode : ((evt.which) ? evt.which : evt.keyCode);
         if (charCode == 13)
              document.getElementById('form1:bt_Save').click();
              return false;
              return true;
    I�m looking for something like that:
    if(charCode == 13) {
    if(document.getElementById('form1:textArea').hasFocus())
    doNothing...
    else {
    document.getElementById('form1:bt_Save').click();
         return false;
    thanks for any help

    Hi,
    I searched through many forums (js of course too) but
    I couldn�t find a solution. Everybody knows how to
    set the focus but not how to get it. We often use
    JSF/JSP with javascript and maybe somebody here has
    another approach to this problem (how to solve it
    using jsf itself or anything else)?Take easy. I just suggested to search in a JavaScript forum , in your question you didn't mentioned this. Good luck man.
    Cya.

  • How to determine output based on the content of purchase order

    Hi Gurus,
    I've a typical requirement at my present project. With vendor X we have punchout catalogs. while creation of shopping cart, we are not allowing the user to mix catalog items and non catalog items into the same shopping cart. Once the shopping cart all shopping carts are automatically coverted into PO.
    Now the challenge we are facing is, if the PO is created based on items from catalog, we want to send such PO via XML interface to the vendor. If the PO is created based of items which are free-form, we want to send such PO via Smartform email attachment.
    As this condition can only be determined at runtime, I'm finding a challenge to configure this. In both PO cases, vendor is same but the content of the PO is different. One contains all items that are catalog based and other contains items which are non catalog.
    Can someone help me find solution for this issue.
    Regards,
    Sam K

    Change Forms for Document Output
    You can use the Business Add-In BBP_OUTPUT_CHANGE_SF to override the Smart Forms that are defined in the activity Define Actions for Document Output.
    This BAdI serves as an alternative to the IMG activity Condition-Dependent Document Output.
    Note that no Smart Forms are used for output via XML.
    Standard settings
    The following parameters are available in the method CHANGE_FORMS. Depending on the input parameters, you can define other Smart Forms to output the document type.
    Importing
    IV_GUID
    Globally Unique Identifier of the document.
    IV_MEDIUM
    Output medium found for this document according to Define Actions for Document Output (print: PRN, fax: FAX, e-mail: MAI, XML: MET).
    IS_PARTNER
    Business partner to whom the document is sent.
    IV_OBJECT_TYPE
    Business transaction type.
    Changing
    CV_SMARTFORM
    Smart Form used to output the document.
    E-mail output
    Smart Form with which the document is added to the e-mail in the form of a PDF attachment.
    Note:
    Note that the BAdI with this parameter overrides the parameter form name (technical name of the Smart Form BBP_PO for example) irrespective of the defined determination technology (SRM: Purchase Order Output Determination, for example).
    CV_SMARTFORM_MAIL
    Smart Form used to define content and layout of the e-mail text in the case of e-mail output.
    CV_SUBJECT_MAIL
    Smart Form that determines the text in the (short description of the e-mail content).
    As an alternative to this BAdI, you can control document output via determination technology.
    For more information, see Condition-Dependent Document Output.
    EXPLORE THIS badi

  • How to determine a BP from the user

    HI Experts,
    We have a scenario where there are contract employee's which are not maintained in the system as employee but maintained as BP, now during creation of any transaction i need to determine the contract BP based on the user, in the user master we are maintaining e-mail, the same is also maintained in the BP, which is also unique, is there any ways i can dtermine the BP in the transaction, please somebody help me, this is very crtical in my project.
    Regards
    Milan

    You can always use badi. To use badi, you would have to define in partner access sequence as source COM_PARTNER_Z (Business add-in 3).
    Then you would have to create your implementation of that badi (spro>crm>basic functons>partner processing>business add-in for partner). In thet badi implement method DETERMINATION_ADD_IN_3 in which you can put whatever logic you need.
    Regards.

  • How can I get the coordinate in the layer coordinate system while doing the iterate?

    I found that the position(x,y) the iterate function tell me is not right sometimes.
    Actually,it happens when the top of the layer is negative. The "y"is in the comp coordinate system(maybe?) but not the layer.In another word, the position with y=0 is not the top.
    More specifically, I have got the color map of a layer. I am able to get the color of any pixel in the layer. But I can't set the color one for one when I use "iterate",because there is an offset.
    Am I supposed to get the offset? Is there any way to access the whole layer directly if I use iterate function?

    so indeed it's the offset at play.
    AE will diminish the buffer at 20% increments, and not for each pixel that
    goes out of sight. it's not really in relation to the upper left corner,
    it's all about what part of your layer buffer is out of sight.
    there's also an "iterate offset function". check it out. perhaps it will
    save you some trouble.
    On Fri, Dec 19, 2014 at 2:45 PM, Hinanawi Tenshi <[email protected]>

  • How to determine # of recs in the data grid - with filter being used

    Say I'm looking at table or view that has 10,000 rows. I put a filter on the filter line such as state = 'WA'. Let's say the data grid (where I see the data clicking the 'data' button) now has 2,500 rows with the filter in effect.
    So, how do I tell how many rows are in the data grid now? I can see how to retrieve the total number of rows for the table or view, but how when a filter is in effect.
    Thanks.

    Okay thanks.
    Sure would have preferred to see (dare I say ... like TOAD) where you can just right click in the data grid and choose record count.
    But thanks - I'll use the COUNT method (till of course it's added 8-)
    Russ

  • How to determine which drive has the most recent backup?

    I have a few drives that contain backups of files. What would be the easiest way to figure out which of the drives has the most recent backup? When I sort by date, the folder shows one date, though the files inside show a different date? Is there a way to quickly check the drives to find which is the most recent?
    Thanks.

    the folder modification date isn't reliable, as is only tells of changed in the folder, but not in subfolders. there is no efficient way. I however highly suggest Time capsule, it is WAY easier and you can ask it not to sync the System data and/or applications, so it would prevent this hassle.
    You could try this: go to the first drive, type different letters, like a for instance, and see which file is the most recent document/folder.
    do the same thing on the other drives and compare.

Maybe you are looking for

  • How to get the query values from the url in a servlet and pass them to jsp

    ok..this is the situation... all applications are routed through a login page... so if we have a url like www.abc.com/appA/login?param1=A&param2=B , the query string must be passed onto a servlet(which is invoked before the login page is displayed)..

  • Gallery problem with 5230 on my 4th phone

    Still have a problem with viewing my photos once I put a couple hundred in my phone under mass storage. Have over 3 gigs available on a 4 gig card and all my photos are under 200kb which are smaller than the ones my phone actually takes. As soon as I

  • Server manager crashing - Fault Module clr.dll

    The Server manager is crashing. As soon as you try to open Server Manager it crashes instantly with the failing module being clr.dll This seems to relate to .net framework and after looking for a hotfix it says to contact Microsoft (who have been les

  • Return to Vendor by 161 Mvt. with Excise Invoice

    Hi We have procured some raw materials with excise paid. While processing GR we found that some materials are not upto the mark. So we created Return Purchase Order for that material and vendor. After that while doing MIGO (161 movement) for return p

  • Send Unix command won't work under 10.2.8

    So I am running this command in a lab of 10.2.8 machines. I go to send Unix Command then I put this in: Send Unix Command user: root osascript -e 'tell application "System Events" to keystroke "map"'; \ osascript -e 'tell application "System Events"