![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Newbie
Join Date: Jun 2005
Location: UK
Posts: 14
Rep Power: 0
![]() |
I have a problem where I need to find the x,y coordinates of a point on a circle.
Imagine a point at the origin. I need to be able to work out what the coordinates would be if it moved a certain number of units in a given direction in degrees. For some reason, after spending an hour or so playing around with sine and cosine my head seems to be going in circles. Can anyone help? Last edited by TooDice; Jun 18th, 2005 at 9:01 PM. |
|
|
|
|
|
#2 |
|
Hobbyist Programmer
Join Date: May 2005
Location: Indiana
Posts: 130
Rep Power: 4
![]() |
Is the trajectory circular with a certain radius, i.e. is it a unit circle?
If the problem were the other way around, it would have been a piece of cake, you would not have needed this extra information about radius, it would cancel out: take arctan(y/x) and you have the angle! EDIT: Anyway, if the radius (r) is known or figured out somehow, then sin(a) = y/r, cos(a) = x/r; a - is the angle measured from the positive x-axis; so then you can get x and y. Last edited by EverLearning; Jun 18th, 2005 at 8:36 PM. |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Jun 2005
Location: UK
Posts: 14
Rep Power: 0
![]() |
Yeah. Basically, find the x,y coordinates of a point on a perfect circle that you would meet if you travelled from the origin in a given direction in degrees. The radius is a variable, but if we use a radius of 1 unit for this example I can just work the rest out fine.
I need a function similar to the progam Logo, where you could type: RIGHT 33 FORWARD 100 The turtle would then move to the correct place. I need to be able to find the x,y coordinates of this point. Accuracy isn't really a problem as I'll round it to an integer anyway, it just needs to look right. EDIT: You happened to edit ur post as I replied. I'll rearrange that and see if I can clean up the mess I made earlier...
__________________
If it squeals, don't smoke it. Last edited by TooDice; Jun 18th, 2005 at 8:41 PM. |
|
|
|
|
|
#4 |
|
Newbie
Join Date: Jun 2005
Location: UK
Posts: 14
Rep Power: 0
![]() |
It worked a treat!
x = cos(a)*r y = sin(a)*r ![]() ![]() ![]() I can safely go to sleep now without nightmares about A-level mathematics.
__________________
If it squeals, don't smoke it. |
|
|
|
|
|
#5 |
|
Hobbyist Programmer
Join Date: May 2005
Location: Indiana
Posts: 130
Rep Power: 4
![]() |
What's A-level mathematics?
|
|
|
|
|
|
#6 |
|
Newbie
Join Date: Jun 2005
Location: UK
Posts: 14
Rep Power: 0
![]() |
You know those guys who are obsessed with calculating Pi to infinite decimal places or finding prime numbers? It's when one of those guys decides to get into teaching.
__________________
If it squeals, don't smoke it. |
|
|
|
|
|
#7 |
|
Hobbyist Programmer
Join Date: May 2005
Location: Indiana
Posts: 130
Rep Power: 4
![]() |
I suppose not, that must be a British thing
![]() Well actually I do, one of them is my DiffEqs instructor ![]() |
|
|
|
|
|
#8 |
|
Newbie
Join Date: Jun 2005
Location: UK
Posts: 14
Rep Power: 0
![]() |
When I was at school, you did your A-levels at the age of 16-17. It was optional and you had to spend two years at college to do it. Nowadays, kids leave secondary school at 16 with three A-levels already under their belt.
No wonder why I can't get a decent job.
__________________
If it squeals, don't smoke it. |
|
|
|
|
|
#9 | |
|
Expert Programmer
|
Quote:
|
|
|
|
|
|
|
#10 |
|
Hobbyist Programmer
Join Date: May 2005
Location: Indiana
Posts: 130
Rep Power: 4
![]() |
In my native country (Russia), everything used to be compulsory, regular exams, everyone on the same page (ah ... the joys of socialism), regular exams. But since couple years ago they are introducing some standardized cr@p
. Glad I'm out ![]() |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|