Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
    Bookmark Topic Watch Topic
  • New Topic

i finish building the fuction but in certain cases..

 
johny doe
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Report post to moderator
it works in all cases exept
when i tried to rotate the point (0,1) around the point (0,0)
180 degrees clock wise instead of giving me the value(0,-1)

it gives me

6.123233995736766E-17,-1.0

when i tried to rotate the point (0,1) around the point (0,0)
270 degrees clock wise instead of giving me the value(-1,0)

it gives me

-1.0,-1.2246467991473532E-16

when i tried to rotate the point (0,1) around the point (0,0)
0 degrees clock wise instead of giving me the value(0,1)

it gives me
6.123233995736766E-17,1.0

i dont know what this E number means
i dont know why it happening??
 
johny doe
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Report post to moderator
the right pos is the top one
i dont know how to edit a post
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Report post to moderator
No idea what this function is you are talking about, but my guess is you are witnessing the accuracy problems you encounted doing floating point calculations.

Or perhaps your logic is just wrong.
[ December 21, 2007: Message edited by: Paul Sturrock ]
 
Akhilesh Trivedi
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
  • Report post to moderator
Originally posted by johny doe:
the right pos is the top one
i dont know how to edit a post

Simple, Click the edit icon (the one with pencil and paper) on your post.
[ December 21, 2007: Message edited by: Akhilesh Trivedi ]
 
Bill Shirley
Ranch Hand
Posts: 457
  • Mark post as helpful
  • send pies
  • Report post to moderator
Note: this is a continuance of a previous thread.

"Johny Doe",

you should

1) keep one discussion in one thread
http://faq.javaranch.com/java/UseOneThreadPerQuestion

2) use useful titles
http://faq.javaranch.com/java/UseAMeaningfulSubjectLine
 
    Bookmark Topic Watch Topic
  • New Topic