Math Help Forum

Math Help Forum Feed Site Feed

Go Back   Math Help Forum > Pre-University Math Help > Trigonometry
Reply
 
Thread Tools Display Modes
  #1  
Old November 5th, 2009, 10:47 AM
Newbie
 
Join Date: Nov 2009
Posts: 4
Country:
Thanks: 1
Thanked 0 Times in 0 Posts
bbagnall is on a distinguished road
Default [SOLVED] Angle between two points on a circle

I'd like to calculate the angle between two points on a circle, in which the radius of the circle is known, as are the coordinates of the two points and the center point. The problem is similar to this one, except I don't want to be limited to one point being at the 12-o'clock position.

Known:
p1 - starting point on circle
p2 - ending point on circle
c - center point on circle
r - radius of circle

Calculate:
central angle

The incomplete solution I came up with is to calculate the distance between the two points first (lets call them p1 and p2):
d = sqrt((x2 - x1)^2 + (y2 - y1)^2)

With that, the angle can be calculated as (r is radius of the circle):
angle = 2asin(d/2r)

The problem with this solution is that it doesn't produce angles over 180 degrees. When it goes over 180 degrees it starts giving the minor angle again, which leaves me unable to determine if the degrees it is giving are clockwise or counter clockwise from the starting point. (Here's a demo showing how to calculate the central angle, and it also runs into the same problem I encountered. It doesn't seem to know how to calculate an angle greater than 180 degrees.)

In other words, I always want this to calculate the angle clockwise from the starting point (p1) to the end point (p2), so that it produces angles up to 360 degrees.

Last edited by bbagnall; November 14th, 2009 at 03:05 PM. Reason: Solved. Updating title.
Reply With Quote
Advertisement
 
  #2  
Old November 10th, 2009, 07:26 AM
Newbie
 
Join Date: Nov 2009
Posts: 4
Country:
Thanks: 1
Thanked 0 Times in 0 Posts
bbagnall is on a distinguished road
Default Inelegant solution

I found a somewhat bloated solution by doing some additional calculations. The name of the game is to check if P2 lies to the left or right (relative) to the line formed by P1 and the opposite side of the circle. To test this condition, you need to create a third point (we'll call it Pa) that lies anywhere along the starting heading:

1. Create a point somewhere on the heading line, an arbitrary distance d. Take heading, h, and subtract 180 degrees:
h1 = h - 180

Calculate Pa (x, y) using:
xa = x1 - d cos h1
ya = y1 - d sin h1

2. Calculate the lengths of all three lines in the triangle formed by P1-P2-Pa:

a = sqrt( (x2 - x1)^2 + (y2 - y1)^2) )
b = sqrt( (xa - x1)^2 + (ya - y1)^2) )
c = sqrt( (x2 - xa)^2 + (y2 - ya)^2) )

3. Now take the law of cosines and rearange the variables to isolate the angle C:
C = acos( (c^2 - a^2 - b^2) / (-2ab) )

4. This generates an angle C. If the angle C is acute, then just use the regular value generated by the equations in my first post above (angle, a value 0-180). If the angle C is obtuse, then use the calculation (360 - angle) to generate values > 180.

I find this pretty tedious, so if anyone has a more elegant solution to derive angles 0 to 360 without all this mumbo-jumbo that would be great.
Reply With Quote
  #3  
Old November 10th, 2009, 08:39 AM
MHF Contributor

 
Join Date: Aug 2006
Posts: 6,718
Thanks: 69
Thanked 2,485 Times in 2,279 Posts
Plato has a reputation beyond reputePlato has a reputation beyond reputePlato has a reputation beyond reputePlato has a reputation beyond reputePlato has a reputation beyond reputePlato has a reputation beyond reputePlato has a reputation beyond reputePlato has a reputation beyond reputePlato has a reputation beyond reputePlato has a reputation beyond reputePlato has a reputation beyond repute
Default

I must really not understand this question.
Because, if you know the coordinates of any three points it is simple to find all the angles.
There is absolutely no reason to involve a circle.

Say A:(a_x,a_y)~,~B:(b_x,b_y),~\&~C:(c_x,c_y) then we can find the measure of \angle ACB.
m(\angle ACB) = \arccos \left( {\frac{{\left( {a_x  - c_x } \right)\left( {b_x  - c_x } \right) + \left( {a_y  - c_y } \right)\left( {b_y  - c_y } \right)}}
{{\sqrt {\left( {a_x  - c_x } \right)^2  + \left( {a_y  - c_y } \right)^2 } \sqrt {\left( {b_x  - c_x } \right)^2  + \left( {b_y  - c_y } \right)^2 } }}} \right)
Reply With Quote
The following users thank Plato for this useful post:
Donate to MHF
  #4  
Old November 12th, 2009, 09:12 AM
Newbie
 
Join Date: Nov 2009
Posts: 4
Country:
Thanks: 1
Thanked 0 Times in 0 Posts
bbagnall is on a distinguished road
Default

Hi Plato,

The angle I was looking for was the central angle, I believe it's called, which is the angle formed by one point on the circle (p1) the center of the circle, and the other point (p2). Since all three points are known, I assume you are correct if your calculation above can produce angles > 180 degrees. Does it?

As it turns out, if you take the angle calculated in my second post above and multiply it by 2, it also comes up with a central angle between 0 - 360 degrees. This was completely by accident, but it does the trick, so the calculations in my first post are redundant. I think the reason it worked out has something to do with the property of central angles shown in this Java applet:
Central Angle Theorem - Math Open Reference

Quote:
Originally Posted by Plato View Post
I must really not understand this question.
Because, if you know the coordinates of any three points it is simple to find all the angles.
There is absolutely no reason to involve a circle.

Say A:(a_x,a_y)~,~B:(b_x,b_y),~\&~C:(c_x,c_y) then we can find the measure of \angle ACB.
m(\angle ACB) = \arccos \left( {\frac{{\left( {a_x  - c_x } \right)\left( {b_x  - c_x } \right) + \left( {a_y  - c_y } \right)\left( {b_y  - c_y } \right)}}{{\sqrt {\left( {a_x  - c_x } \right)^2  + \left( {a_y  - c_y } \right)^2 } \sqrt {\left( {b_x  - c_x } \right)^2  + \left( {b_y  - c_y } \right)^2 } }}} \right)
Reply With Quote
  #5  
Old November 12th, 2009, 09:25 AM
MHF Contributor

 
Join Date: Aug 2006
Posts: 6,718
Thanks: 69
Thanked 2,485 Times in 2,279 Posts
Plato has a reputation beyond reputePlato has a reputation beyond reputePlato has a reputation beyond reputePlato has a reputation beyond reputePlato has a reputation beyond reputePlato has a reputation beyond reputePlato has a reputation beyond reputePlato has a reputation beyond reputePlato has a reputation beyond reputePlato has a reputation beyond reputePlato has a reputation beyond repute
Default

No angle has a measure greater than \pi\text{ or }180^o.
Reply With Quote
  #6  
Old November 14th, 2009, 02:34 PM
Newbie
 
Join Date: Nov 2009
Posts: 4
Country:
Thanks: 1
Thanked 0 Times in 0 Posts
bbagnall is on a distinguished road
Default angle versus arc

Quote:
Originally Posted by Plato View Post
No angle has a measure greater than \pi\text{ or }180^o.
Is that even true? The Wikipedia article talks about positive and negative angles of 325 degrees:
Angle - Wikipedia, the free encyclopedia

I take it your equation above is unable to produce anything greater than 180 degrees so you're trying to get me with some sort of semantic difference here between an angle and arc. Can an arc have >180 degrees? If that's the case, I'm looking for an arc between 0 and 360 degrees.

In any event, my equation above is able to deliver a thingamajig between 0 and 360 degrees. Problem solved.

Last edited by bbagnall; November 14th, 2009 at 02:42 PM. Reason: Added Wiki article
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump


All times are GMT -7. The time now is 05:26 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 ©2008, Crawlability, Inc.
©2005 - 2009 Math Help Forum


Math Help Forum is a community of maths forums with an emphasis on maths help in all levels of mathematics.
Register to post your math questions or just hang out and try some of our math games or visit the arcade.