Finding coordinates of a point in a circle with angle

AI Thread Summary
To find the coordinates of a point on a circle given an angle and distance, the formula (x_?, y_?) = (x + d*cos(a), y + d*sin(a)) is used. The discussion highlights a coding issue where the calculated points were incorrect, leading to confusion about the angle measurements. It was discovered that the problem stemmed from using radians instead of degrees in the calculations. The user expressed gratitude for the clarification, noting the importance of checking measurement units in programming. This exchange emphasizes the common pitfalls in trigonometric calculations and the significance of unit consistency.
AlicanC
Messages
3
Reaction score
0
I have a point (x,y), a distance (d) and an angle (a). I need a method to find a point using x,y,d and a. For example:
http://c.imagehost.org/0836/03082008299.png
I will apply this on a 3D environment, but I am not going to use the 3rd dimension so it's safe.
This is also about programming, but I am capable of applying methods in the programming language so I asked it here.
 
Last edited by a moderator:
Mathematics news on Phys.org
<br /> (x_?,y_?) = (x+d\cos\alpha,y+d\sin\alpha)<br />
 
Thanks for the answer, but I have a problem. I wrote some code to put this in action. The code starts from "0" and adds "20" to the angle until the vaule is greater than to "360". I don't know why but the code produced this:
http://c.imagehost.org/0346/2008-08-03_092702.png
As you can see there are some mistakes. All are getting repeated but the ones I marked. Here is the debug output I get:
(1) Center of the circle located at (-49.013168, -1082.446166)
(1) Drawing at (50.986831, -1082.446166) Angle is 0.000000
(1) Drawing at (-8.204959, -991.151611) Angle is 20.000000
(1) Drawing at (-115.706977, -1007.934875) Angle is 40.000000
(1) Drawing at (-144.254455, -1112.927246) Angle is 60.000000
(1) Drawing at (-60.051891, -1181.835083) Angle is 80.000000
(1) Drawing at (37.218719, -1133.082763) Angle is 100.000000
(1) Drawing at (32.404930, -1024.385009) Angle is 120.000000
(1) Drawing at (-68.794525, -984.422180) Angle is 140.000000
(1) Drawing at (-146.576110, -1060.503662) Angle is 160.000000
(1) Drawing at (-108.859176, -1162.561401) Angle is 180.000000
(1) Drawing at (-0.294399, -1169.775878) Angle is 200.000000
(1) Drawing at (50.595352, -1073.606323) Angle is 220.000000
(1) Drawing at (-16.435035, -987.901672) Angle is 240.000000
(1) Drawing at (-122.032585, -1014.122192) Angle is 260.000000
(1) Drawing at (-141.187133, -1121.227050) Angle is 280.000000
(1) Drawing at (-51.222831, -1182.421752) Angle is 300.000000
(1) Drawing at (41.357345, -1125.261718) Angle is 320.000000
(1) Drawing at (26.953659, -1017.415100) Angle is 340.000000
(1) Drawing at (-77.382278, -986.554565) Angle is 360.000000
As you can see some values are too close. I am really bad at trigonometry, so I can't find the problem.
 
Last edited by a moderator:
The center is at (-49, -1082) and your first point, with the angle, 0 is at
(51, -1082) then radius, d, is 100.

So, when the angle is 20 the point should be
100(\cos(20)) + -49 \approx 45
100(\sin(20))+ -1082 \approx -1048

But you have:

Drawing at (-8.204959, -991.151611) Angle is 20.000000

*Could you be in radians instead of degrees?
 
futurebird said:
Could you be in radians instead of degrees?
Ah, you are right! I was making calculations with radians.

Thank you both so much! I was trying to figure this out for two days! Normally I post my questions to forums related to coding or just ask my friends, but can't get an answer :D
 
futurebird said:
Could you be in radians instead of degrees?
Always a problem if you forget. When I get errors like that, the first thing I do is to check the mode on my calculator. Lol.
 
Thread 'Video on imaginary numbers and some queries'
Hi, I was watching the following video. I found some points confusing. Could you please help me to understand the gaps? Thanks, in advance! Question 1: Around 4:22, the video says the following. So for those mathematicians, negative numbers didn't exist. You could subtract, that is find the difference between two positive quantities, but you couldn't have a negative answer or negative coefficients. Mathematicians were so averse to negative numbers that there was no single quadratic...
Thread 'Unit Circle Double Angle Derivations'
Here I made a terrible mistake of assuming this to be an equilateral triangle and set 2sinx=1 => x=pi/6. Although this did derive the double angle formulas it also led into a terrible mess trying to find all the combinations of sides. I must have been tired and just assumed 6x=180 and 2sinx=1. By that time, I was so mindset that I nearly scolded a person for even saying 90-x. I wonder if this is a case of biased observation that seeks to dis credit me like Jesus of Nazareth since in reality...
Fermat's Last Theorem has long been one of the most famous mathematical problems, and is now one of the most famous theorems. It simply states that the equation $$ a^n+b^n=c^n $$ has no solutions with positive integers if ##n>2.## It was named after Pierre de Fermat (1607-1665). The problem itself stems from the book Arithmetica by Diophantus of Alexandria. It gained popularity because Fermat noted in his copy "Cubum autem in duos cubos, aut quadratoquadratum in duos quadratoquadratos, et...
Back
Top