depressed by degrees problem
Hi, I am a complete green horn on trig and have bought a rather naff "Trigonometry for Dummies" book that is beyond me.
I do not accept I cannot learn it as this book is not written in a way I can understand so have ordered another title.
Anyway onto my problem!
The coordinate plain is on the iPhone which is 320 * 460
The circle centre (is this the origin) is 160, 230
I use these equations to get my distance from centre and the degrees that this distance represents around the inside of the circle.
kSlideCentreX = 160 and kSlideCentreY = 230
Code:
distanceFromCentre = sqrt(((currentPosition.x - kSlideCentreX ) * (currentPosition.x - kSlideCentreX)) - ((currentPosition.y - kSlideCentreY) * ( currentPosition.y - kSlideCentreY)));
this is how I get the slope
Code:
slope = (kSlideCentreY - currentPosition.y) / (kSlideCentreX - currentPosition.x);
this gives me the radians
kRadiansPerDegree = 0.0174532f
gives me the degrees ( but not fixed yet )
Code:
atan(slope) / kRadiansPerDegree
this is supposed to fix them to real degrees?
Code:
90 - ( atan(slope) / kRadiansPerDegree)
my problem is that any coords on the right of the circle run from 180 degrees at the top (12) to 0 at the bottom (6), and on the left side from 180 at the bottom (6) to 0 at the top (12).
I can understand and learn things as long as they are done so in a fashion my brain can grasp (Worried)
I am searching and searching but coming up blank probably due to not asking the right question or how to phrase it.
I would be very grateful if someone could point me in the right direction or if feeling very friendly and helpful tutor me through this problem so I can learn from it and expand?
in hope......
Thanks