BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Finding angle between 'vertical' line and line hitting edge

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics
View previous topic :: View next topic  
Author Message
Paul Nicholls
Guest





PostPosted: Sun Nov 21, 2004 11:21 pm    Post subject: Finding angle between 'vertical' line and line hitting edge Reply with quote



A C
|
____ |
/r |
|--. | |
(x,y) / |
----/ |
|
|
|
O |
|
|
|
B


Looking at my ascii art above,
is there a fast way of finding out the angle between the line B-C and
the line B-A that is hitting the side of the circle at (x,y) of radius r?

--
Cheers,
Paul.

"The plastic veneer of civilization is easily melted in the heat of the
momemt" - Paul Nicholls.
[email]paul_nicholls (AT) hotmail (DOT) NOSPAM.com[/email]

Remove ".NOSPAM" to reply.


Back to top
Paul Nicholls
Guest





PostPosted: Sun Nov 21, 2004 11:51 pm    Post subject: Re: Finding angle between 'vertical' line and line hitting e Reply with quote



"Paul Nicholls" <paul_nicholls (AT) hotmail (DOT) NOSPAM.com> wrote

Quote:
A C
|
____ |
/r |
|--. | |
(x,y) / |
----/ |
|
|
|
O |
|
|
|
B


Looking at my ascii art above,
is there a fast way of finding out the angle between the line B-C and
the line B-A that is hitting the side of the circle at (x,y) of radius r?

--
Cheers,
Paul.

Actually it would be better if I asked this:

Assuming line B-C as 0 degrees for O, lines on the left of B-C being +ve
degrees, and any lines on the right of B-C being -ve degrees...

is there a fast way of finding out the max and min angles of the 2 lines
extending from the origin B to 1 point on each side of the circle (upto a
max/min of +90/-90 degrees from the 0 degree line)?



Back to top
Nils Haeck
Guest





PostPosted: Mon Nov 22, 2004 3:59 am    Post subject: Re: Finding angle between 'vertical' line and line hitting e Reply with quote



Hi Paul,

Let's define these:

Point D is center of circle (your x, y)
Point E is where the line AB touches the radius.
Point F is the point when you drop a line from D down and where it crosses
AB
Point G is the point going from F to the right until it hits BC

Since DE must be orthogonal to AB, you can say:

tan(ve) = |DE| / |DF| (1) or

tan(ve) = r / |DF| (2) since r = |DE|

Triangles BAC and BFG are congruent, so

Quote:
BG| : |BC| = |GF| : |AC| or

BG| = (x /|AC|) * |BC| (3) (assuming x positive to left from C)

You also know that

y + |DF| + |BG| = |BC| so (assuming y positive downwards from C)

Quote:
DF| = |BC| - |BG| - y (4)

Now use (3) in (4), then (4) in (2):

tan(ve) = r / ( |BC| - ((x /|AC|) * |BC|) - y) or

-1 r
ve = tan (---------------------------)
(1 - (x / |AC|)) * |BC| - y


That's about best you can do.. you'll need at least one inverse goniometric
function and the rest is basic geometry.

I didn't check for errors Smile I suggest you draw it out first and check
carefully.

Nils Haeck
www.simdesign.nl


"Paul Nicholls" <paul_nicholls (AT) hotmail (DOT) NOSPAM.com> wrote

Quote:
"Paul Nicholls" <paul_nicholls (AT) hotmail (DOT) NOSPAM.com> wrote in message
news:41a12311 (AT) newsgroups (DOT) borland.com...
A C
|
____ |
/r |
|--. | |
(x,y) / |
----/ |
|
|
|
O |
|
|
|
B


Looking at my ascii art above,
is there a fast way of finding out the angle between the line B-C and
the line B-A that is hitting the side of the circle at (x,y) of radius
r?

--
Cheers,
Paul.

Actually it would be better if I asked this:

Assuming line B-C as 0 degrees for O, lines on the left of B-C being +ve
degrees, and any lines on the right of B-C being -ve degrees...

is there a fast way of finding out the max and min angles of the 2 lines
extending from the origin B to 1 point on each side of the circle (upto a
max/min of +90/-90 degrees from the 0 degree line)?





Back to top
Mr. X
Guest





PostPosted: Mon Nov 22, 2004 5:43 pm    Post subject: Re: Finding angle between 'vertical' line and line hitting e Reply with quote

how about the old trigonometry book ? Smile
Think Nils has already answered ...
Rgds

"Paul Nicholls" <paul_nicholls (AT) hotmail (DOT) NOSPAM.com> wrote

Quote:
A C
|
____ |
/r |
|--. | |
(x,y) / |
----/ |
|
|
|
O |
|
|
|
B


Looking at my ascii art above,
is there a fast way of finding out the angle between the line B-C and
the line B-A that is hitting the side of the circle at (x,y) of radius r?

--
Cheers,
Paul.

"The plastic veneer of civilization is easily melted in the heat of the
momemt" - Paul Nicholls.
[email]paul_nicholls (AT) hotmail (DOT) NOSPAM.com[/email]

Remove ".NOSPAM" to reply.





Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.