|
-
Dec 31st, 2003, 12:17 AM
#1
Thread Starter
Hyperactive Member
how do u find the angle of these points?
Hello everyone, I was reading next semesters programming book and I can't even figure out how to do this problem on paper, so It doesn't look like i'll be programming it anytime soon. Here's my question, They say, design and implement a class called circle_location to keep track of the postion of a single point that travels around a circle. An object of this clas records the position of the point as an angle, measured in a clockwise direction from the top of the circle. Programming this isn't my problem, but I'm confused on how i'm suppose to figure out the angle of the point. So say I have a point at (0,0) and (3,3) this would make a line then I could draw a vertical line down to make a right angle, but how would I find the angle of that? with just given 2 points? Or am i misunderstanding what they really want me to do?
Thanks!
C¤ry Sanchez
Computer Science/Engineering
@ Penn State
IBM.zSeries Intern
Mandriva 2007
-
Dec 31st, 2003, 02:08 AM
#2
transcendental analytic
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jan 1st, 2004, 01:31 PM
#3
You can use tan-1 (abs(y1 - y2))/(abs(x1 - x2))
With the originating point being (x2, y2) and the other being (x1, y1). Now, you'll have to use whether (y1 - y2) and (x1 - x2) or positive or negative to tell you which quadrant it's in.
- , + = quadrant 4
- , - = quadrant 3
+ , - = quadrant 2
+ , + = quadrant 1
I'm sure there are other ways (like somehow using the parametric representation of a circle and solving for T), but that *should* work with some fiddling around.
The time you enjoy wasting is not wasted time.
Bertrand Russell
<- Remember to rate posts you find helpful.
-
Jan 2nd, 2004, 11:52 AM
#4
Thread Starter
Hyperactive Member
Thanks jemidiah, That will work great!
C¤ry Sanchez
Computer Science/Engineering
@ Penn State
IBM.zSeries Intern
Mandriva 2007
-
Jan 2nd, 2004, 09:56 PM
#5
One thing I remembered: when x1 - x2 = 0, you'd get a divide by zero error (duh), so the angle'll be 90
The time you enjoy wasting is not wasted time.
Bertrand Russell
<- Remember to rate posts you find helpful.
-
Jan 4th, 2004, 05:14 AM
#6
Hyperactive Member
yeh its infinity and tan 90 is infinity
-
Jan 4th, 2004, 01:27 PM
#7
Lively Member
I haven't nit-picked for a while, so here goes:
tan90o is infinite not infinity, they are different.
-
Jan 4th, 2004, 03:43 PM
#8
transcendental analytic
I thought tan 90° was not defined, likewise cot 0° csc 0° and sec 90°
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jan 4th, 2004, 05:56 PM
#9
They're all divide by zero errors, so you could debate about anything you want (search the forums if you really want to see war )
The time you enjoy wasting is not wasted time.
Bertrand Russell
<- Remember to rate posts you find helpful.
-
Jan 4th, 2004, 06:41 PM
#10
transcendental analytic
yeah but i dont like war.. or nit picking for that matter I just thought some general info on how to use trigonometry would do good.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|