Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: oop, directions

  1. #1
    Member
    Join Date
    Mar 2013
    Posts
    47
    My Mood
    Amused
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Question oop, directions

    I was just wondering, in object orientend programming, how would you assaign a direction for an object.
    For example:

    Lets say I have an object in position (100, 350) and but I wont it to move to point ( 600, 39)
    How would I give the object a direction it could move towards? would you use pythagoras theorem


  2. #2
    Super Moderator pbrockway2's Avatar
    Join Date
    Jan 2012
    Posts
    956
    Thanks
    7
    Thanked 204 Times in 180 Posts

    Default Re: oop, directions

    The direction isn't given by Pythgoras' theorem, rather use the definition of tan(x). The Math class has a couple of inverse tan methods that are useful.

    ---

    I'm not sure this has anything to do with object oriented programming.

Similar Threads

  1. Not getting the OOP thing!!!
    By AffiliateOwen in forum Java Theory & Questions
    Replies: 7
    Last Post: April 16th, 2013, 10:44 AM
  2. [SOLVED] Quick Question: Did I understand these directions correctly?
    By msinc210 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: June 3rd, 2012, 04:03 PM
  3. [SOLVED] Directions Buttons needs picture
    By Darkcore123 in forum What's Wrong With My Code?
    Replies: 5
    Last Post: December 14th, 2011, 11:19 AM
  4. OOP help!
    By imaznumkay in forum Object Oriented Programming
    Replies: 3
    Last Post: July 11th, 2011, 02:43 PM
  5. OOP
    By mgutierrez19 in forum Object Oriented Programming
    Replies: 2
    Last Post: November 29th, 2009, 10:10 PM