Results 1 to 11 of 11
  1. #1
    veelicus is offline Member
    Join Date
    Dec 2013
    Posts
    2
    Rep Power
    0

    Default how to calculate sinus/angle between two points

    Hi,
    I need to know the sinus or angle between two points (x1,y1) and (x2,y2).
    ¿someone knows a formulae to calculate this?

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is online now Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,965
    Rep Power
    8

    Default Re: how to calculate sinus/angle between two points

    Basic trigonometry?
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    veelicus is offline Member
    Join Date
    Dec 2013
    Posts
    2
    Rep Power
    0

    Default Re: how to calculate sinus/angle between two points

    yes, but i don't know if there is a fast way using any lib to get the solution

  4. #4
    jim829 is online now Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,619
    Rep Power
    5

    Default Re: how to calculate sinus/angle between two points

    I am not certain what you mean. Two points constitute a straight line. So what angle are you talking about?

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  5. #5
    KevinWorkman's Avatar
    KevinWorkman is online now Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,965
    Rep Power
    8

    Default Re: how to calculate sinus/angle between two points

    Quote Originally Posted by veelicus View Post
    yes, but i don't know if there is a fast way using any lib to get the solution
    Check out the API for the Math class.

    Java Platform SE 7
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  6. #6
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,538
    Blog Entries
    7
    Rep Power
    20

    Default Re: how to calculate sinus/angle between two points

    Quote Originally Posted by veelicus View Post
    Hi,
    I need to know the sinus or angle between two points (x1,y1) and (x2,y2).
    ¿someone knows a formulae to calculate this?
    Sigh, don't they teach basic math 101 anymore? Subtract, say P1 from both P1 and P2; you get O= (0, 0) and X= (x2-x1, y2-y1) == (x, y). The hypothenuse of the triangle is h= sqrt(x*x+y*y); the sine is y/h, the cosine is x/h and the tangent is y/x. People nowadays first start banging their keyboards without thinking and then they are stuck ...

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  7. #7
    jim829 is online now Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,619
    Rep Power
    5

    Default Re: how to calculate sinus/angle between two points

    I would agree if the OP had said that was the hypotenuse. But one could also assume it was one of the other sides. So the question as stated makes no sense.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  8. #8
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,538
    Blog Entries
    7
    Rep Power
    20

    Default Re: how to calculate sinus/angle between two points

    Quote Originally Posted by jim829 View Post
    I would agree if the OP had said that was the hypotenuse. But one could also assume it was one of the other sides. So the question as stated makes no sense.
    True; I have been lecturing for a short while (at a university by Jove) and I learned to complete, reinterpret and understand poorly worded questions that didn't make sense at all, The communication the other way around needs to be compact, exact and to the point at max and delivered prompty, otherwise the lecturer were sloppy, was an *sshole etc. etc. etc. ;-)

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  9. #9
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,030
    Rep Power
    6

    Default Re: how to calculate sinus/angle between two points

    Quote Originally Posted by JosAH View Post
    was an *sshole etc. etc. etc. ;-)
    Yeah well sometimes they really are! ;)

    One thing I have come to realize: the unfinished questions people would ask in a classroom are absolutely not of the same level of incompleteness as the questions asked in forums.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  10. #10
    Daryn is offline Senior Member
    Join Date
    Oct 2012
    Posts
    176
    Rep Power
    2

    Default Re: how to calculate sinus/angle between two points

    Hang on hes talking about hypotneus? How do you see that i figuered he was trying to do slope
    With the right know how, anything is possible

  11. #11
    KevinWorkman's Avatar
    KevinWorkman is online now Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,965
    Rep Power
    8

    Default Re: how to calculate sinus/angle between two points

    Quote Originally Posted by Daryn View Post
    Hang on hes talking about hypotneus? How do you see that i figuered he was trying to do slope
    You can make an imaginary triangle out of the slope, with the slope being the hypotenuse.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. Replies: 1
    Last Post: 11-06-2013, 10:14 AM
  2. Replies: 1
    Last Post: 08-11-2011, 10:46 AM
  3. calculating the angle between 3 points
    By imorio in forum New To Java
    Replies: 2
    Last Post: 12-24-2010, 08:49 AM
  4. Angle to Radians and Calculate the Cosine
    By coldplay7588 in forum New To Java
    Replies: 7
    Last Post: 09-26-2010, 08:12 PM
  5. Calculate X and Y given starting angle and distance
    By nidhirastogi in forum Java 2D
    Replies: 5
    Last Post: 08-18-2008, 10:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •