How to store and use coordinates

I need to store 2d coordinates and use them in solving equations and pass them into methods. For example, I need to store the coordinates of a corner of a rectangle (5,10). Then I need to use that point and solve for certain variables in a equation ((5,10) = (0,0) + 2*x and solve for x). I would then need to pass x into a method and perform additional operations on that. How would I go about doing this? I tried searching around but did not get anything helpful.

kramish wrote:
BigDaddyLoveHandles wrote:
Point2D doesn't come with much functionality -- for example, it doesn't have any vector-like methods to add or subtract points or multiple them by a scalar. You'll have to do the math yourself.Surely (and I havent looked into this) the Java 3D libraries would have tonnes of classes for vector maths available?
Maybe you could look into them.True, but if all the OP is trying to do is the odd "pt1 - pt2" or "2*pt", he should just write the code:
public static Point2D plus(Point2D p1, Point2D p2) {
    return new Point2D.Double(p1.getX() + p2.getX(), p1.getY() + p2.getY());
}

Similar Messages

  • How to store and use the BLOB data in Oracle 11G?

    Recentlly,when I tested the Blob data in Oracle11G ,I found that there were too many differences between the SQL
    Server and the Orcale on the capabilities.In Orcale ,I created the table like this:
    create table point
    xid number(10) primary key,
    North number(30,15) default null,
    West number(30,15) default null,
    South number(30,15) default null,
    East number(30,15) default null,
    Area number(30,15) default null,
    Len number(30,15) default null,
    Geometry BLOB default null
    organization index overflow
    tablespace "Tab1"
    lob (Geometry) store as securefile
    tablespace "Tab1"
    enable storeage in row
    chunk 4096
    pctversion 20
    nocache
    no logging
    compress high
    and I stored 10248 rows in this table,
    then ,I used "select geometry from point where xid > ? and xid < ?" as the testing SQL langauage in Java and the
    programme runed once per 5000 pieces of memory.
    the total time used in Orcale is twice more than that in SQLServer.In my Application programs, once the same
    orders runed,their differences were three times and more.As usually,the capability of Orcale is more strongger
    than the SQLServer.Why?

    select geometry from point where xid > ? and xid < ?"Does an index on XID exist?
    Are statistics current for table & indexes?

  • How to store and retrieve blob data type in/from oracle database using JSP

    how to store and retrieve blob data type in/from oracle database using JSP and not using servlet
    thanks

    JSP? Why?
    start here: [http://java.sun.com/developer/onlineTraining/JSPIntro/contents.html]

  • I'm trying to use my older Acrobat 4 for printing files from an older Macintosh with system 9, so that I can store and use the pdf documents in a newer MacBook Air, with OSX 10.9.  Acrobat 4 worked previously but no longer works.  Any way to fix it?

    I am trying to transfer older files from a Mac PowerBook G4, running system 9, printing those documents as pdf, using Acrobat 4.  Then those pdf documents will transfer to my newer MacBook Air, running OSX 10, allowing me to store and use them.  My problem is that Acrobat 4 no longer seems to work on the old Mac, and I don't know how to fix it.  Can anyone give me some suggestions?

    You never know, someone might remember. What happens in detail when you try to use it, and HOW are you trying to use it?

  • I have an iMac about a year old. It has OSX 10.8.3 with iMovie 9.0.8. Is there a way to get iMovie to store and use iMovie Events on an external drive? Raw video is eating up my 1TB internal drive.

    I have an iMac about a year old. It has OSX 10.8.3 with iMovie 9.0.8. Is there a way to get iMovie to store and use iMovie Events on an external drive? Raw video is eating up my 1TB internal drive.

    Yes, you can import to an external drive by choosing it from the Import Screen.
    Once an Event or Project is in iMovie, it is best to move it to the external using iMovie, so the Project does not lose links to the Event.
    For full instructions on how to do this, see this link.
    https://discussions.apple.com/docs/DOC-4141

  • How to Set and Use a global variable within a session?

    Dear All,
    I'm new to jsp, and would like to ask how to set and use a global variable within a session?
    Thanks in advance.
    Regards,
    Cecil

    With session.setAttribute("name",object) you can store a Attribute in the session object.
    with session.getAttribute("name") you can get it.
    That's it.
    Regards,
    Geri

  • How to create and use mutable array of UInt8

    Hello!
    If I get it right, UInt8 *buffer, buffer - is a pointer to a start of array?
    Then how to create and use mutable array of UInt8 pointers?
    The main target is a creation of the module that will store some byte array requests and will send all of them at the propriate moment.

    I try
    - (void) scheduleRequest:(UInt8 *)request {
    if (!scheduledRequests) scheduledRequests = [[NSMutableArray array] retain];
    [scheduledRequests addObject:request];
    But get warning:"passing argument 1 of 'addObject:' from incompatible pointer type"

  • How to Download and Use HP iPrint for Android, iPhone, and iPod Touch

    Greetings iPrint users!
    The following documents contain instructions for downloading the iPrint Application and use the app to print photos.
    Included on each page are step-by-step instructions with screen shots, as well as a video walkthrough.
    iPhone and iPod Touch Users
    How to Download and Use HP iPrint for iPhone and iPod Touch
    Android Users
    How to Download and Use HP iPrint for Android
    Happy Printing
    I am an HP Employee
    Click the KUDOS Star to say "Thanks"
    Please mark the post that solves your problem as "Accepted Solution"

    Hi nstav,
    I'm sorry that you are having problems finding the app to print from your iPad to your Photosmart Premium C309a.
    The app you are looking for is HP's ePrint Mobile app.  You can find it in the Apple App Store or iTunes.  I have included a link to a document about getting started with the app.  I have also included an FAQ document for the app.
    Getting Started with HP ePrint Mobile Apps
    http://h10025.www1.hp.com/ewfrf/wc/document?cc=us&lc=en&dlc=en&docname=c01616126
    HP ePrint Mobile App FAQs
    http://h10025.www1.hp.com/ewfrf/wc/document?cc=us&lc=en&dlc=en&docname=c01923321
    Regards,
    Happytohelp01
    Please click on the Thumbs Up on the right to say “Thanks” for helping!
    Please click “Accept as Solution ” on the post that solves your issue to help others find the solution.
    I work on behalf of HP

  • How to store and access passwords on Keychain?

    I would like to know how to securely store and access passwords on Keychain?

    This article should answer your questions regarding setting up and using iCloud Keychain: http://9to5mac.com/2013/10/26/how-to-setup-and-use-icloud-keychain-for-mavericks -and-ios-7/

  • LRv3.2 Networking with an Asst , How to store and retrieve updated work on Win7?

    LRv3.2 Networking with an Asst , How to store and retrieve updated work on Win7 Network?
    We have a working 1gig network in Win7 PRO 64-bit.  and using LRv3.2
    * How do I configure our Files or Cataloges "so"  ALL Edits are veiwable/edit to all?   (we don't work on the Same Shoot/Folder at the same time)
    I NEED to see,  ALL the LR  Edits  (is great with DNG files
    *** BUT,  what I cannot see if I remember correctly (with just the DNG sharing)  is the  CROP or Virtual Copys ... possibly the Brush edits.
    HOW, do I configure to be able to read and edit ...  ALL of the updated/saved  Edits???   (after it is done by my asst.)
    Is creating a New Catalog for EACH  shoot the way to go?   (not sure I like this idea)
    Right now everything is in one(1) catalog  ... and it's getting big ... BUT, this allows us to search , and group ... going way back.
    Would be nice to be able to still do this easily, and with what we have already done.
    With our one BIG Catalog ... not sure if two(2) can access this catalog over the Network at the same time?
    Even though we never Edit the Same Folder or Files at the same time.
    Or will that be a problem over a simple Win7 PRO network?
    Thank you,
    HG

    Aloha Bob,
    Saw your link.  thank you.
    At least I don't feel "alone"  LOL
    At this point ... I am looking for a  "cluncky"   Work Around?
    * I was thinking,  Maybe making a copy of  My Cataloge ...
    Deleting ALL the  Folders in LR  ... except for the one's  that  will be worked by the Asst.
    Then moving that file to the  Asst.  Computer.
    * NEXT,  pointing the  Folder that they are working on ... across the Network to the Servers Files.
    * After they work on it:
    *** IS THERE A WAY ...
    * To  take that Cataloge ... and UPDATE  my Main  Cataloge.
    THIS, is the STEP  ... I don't know how to do.
    Can someone Help me with this?
    Step by Step,  because I am clueless ....
    Talking UPDATE of everything worked on ... including   Virtual copys, and  CROPS.
    Thank you,
    HG

  • How the store and retrieval in ServletContext will happen??

    Hello Sir,
    I am developing a chat application thats in Swing & servlets Now I am able to authenticate user and I am using ArrayList to maintain the names of the user globally my storing it in ServletContext
    How to store and retrieve ArrayList from Servletcontext
    And another thing is that we are having personal chat(1-to-1) also. But how to use the thread model is not known to us as we have not faced such a situation before
    So if you could suggest some example code or snippets ot certain links then it would be of great help to us
    Thanks
    Regards
    Monarch

    Hello
    thanks for your reply. Actually we are doing the same thing that u have mentioned in your reply.
    The thing we are trying to do is that when a user is logged in the particular servlet which is responsible for the authentiacation of the user will authenticate the user an then calls method in the Chatter class which is outside the servlet
    The Chatter class declares two mwthods addChatter() and getChatter()
    I am managing the currently logged users in Arraylist using this two mehtods above
    When the first user logs in his entry gets stored at the first position in the arraylist but when other user logs in then his entry overrites the entry of the first user instead of getting stored in the next position.
    The arraylist gets initialized when second user logs in. to overcome this problem i want to store the arraylist into the ServletContext so it will be unique for the whole application and will not get initialized
    So I want to know the process of storing and retrieving the arraylist fro the context
    Hope ull understand me and reply me
    Thanks
    Regards
    Monarch

  • HT3529 Is there a way to create, store and use preset messages for use with "Messages"?

    Is there a way to create, store and use preset messages for use with "Messages". I often have a recurrinig message to send, after a repeating event, and need to enter the same short message each time. It would be nice to have this short message stored and selectable so that I do not need to enter each time.

    found an answer that seems to work:
    https://discussions.apple.com/message/17997300#17997300

  • How to install and use a plug-in downloaded from the apple site?

    how to install and use a plug-in downloaded from the apple site?

    Emelie,
    which plug-in do you want to install?
    some of the plug-ins come with an installer on the disk image, you click the installer and it will install it in its proper location.
    For others you move the plug-in into to System Library or your User Library:
      Your Hard disk  > Library > Application Support >Aperture > Plug-Ins > Edit
    or
    Your Home Folder > Library > Application Support >Aperture > Plug-Ins > Edit
    If it is an "Edit" plug-in, it goes into the "Edit" subfolder, "Export" plug-ins into the "Export" subfolder.
    You can tell by the extension, what kind of plug-in it is.
    E.G. BorderFX.ApertureExport is an export plug-in, BorderFXEditPlugin.ApertureEdit an edit plug-in.
    Regards
    Léonie
    P.S. In OS Lion the Libraries are hidden by default: To reveal your User Library activate the Finder and select from the main Finder menu:
        Finder >  Go , then hold down the ⌥-option-key, untill the Library appears in the drop.down menu.
    To show the System Library:
         Finder >  Go > Go to Folder
    then enter   / Library

  • HOW TO CREATE  and  USE EVENTS IN WORKFLOWS .

    HOW TO CREATE  and  USE EVENTS IN WORKFLOWS with the help of classes.
    What i am doing is..
    open se24
    event tab->event name->parameters
    method tab->method name->event handler->copy parameters
    interface tab->if_workflow->enter
    tell me what else to do step by step
    Another important thing is that HOW to use these class events to trigger the workflows.
    REPLY ASAP
    THXS IN ADVANCE

    Hi,
    Pl. see this blog...
    Raising ABAP OO events for workflow
    Regards,
    JOy.

  • How to Create  and use of Coherence servers in weblogic serevr 11g (10.3.6)?

    how to Create  and use of Coherence servers in weblogic serevr 11g (10.3.6)?

    See the below discussion
    How to create and use Webservice controls using WSDL in weblogic portal10.3
    Thanks,
    Venkat Sarvabatla

Maybe you are looking for

  • Itunes 6 wont appear to download??

    Ok, so when I click on the itunes 6 download now! The only thing that happens is just the left side of the box that appears. It tells me what itunes 6 has and everything but there is no other button to download itunes 6. What should I do?? thx Martin

  • Set Focus target when Add New Instance

    [LC Designer ES2 9.0] Using Action Builder to add a new instance of subform SITE, where first field is called SiteName. If I set action to Set Focus to SiteName, the focus goes to the *original* SiteName field instead of to the new instance. Users wi

  • IMac G5 Computer Shuts Down Unexpectedly

    No unusual circumstances, computer has shut down unexpectedly without warning four times this morning. Any ideas?

  • Detecting differences between two databases

    We've two big databases (20 Gb) on essbase 6.5 and System 9. We need to know if there are any differences between them. Is there a way to do that different from querying both databases with a lot of reports and comparing them? Any suggestion will be

  • International messaging not working

    I'm currently travelling (in Argentina right now) & many of my text messages back home to the UK aren't being received.I've been told by my network provider that this is because the phone settings are overriding the dialling code, to apply the local