JOIN
Get Time
forums   
Search | Watch Thread  |  My Post History  |  My Watches  |  User Settings
View: Flat (newest first)  | Threaded  | Tree
Previous Thread  |  Next Thread
error? | Reply
I'am reading lbackstrom's very nice geometry tutorial (because of 280div1 hard) and wonder whether I found a bug. That's not really important but I want to know if I'm misunderstanding it.

It's about this section:
<div style="text-align: center"><img src="http://www.topcoder.com/i/education/geometry04.png" /></div>
First, check to see if the nearest point on the line AB is beyond B (as in the example above) by taking AB ⋅ BC. If this value is greater than 0, it means that the angle between AB and BC is between -90 and 90, exclusive, and therefore the nearest point on the segment AB will be B.

Shouldn't that be "less than" and "between 90 and 270"?

(btw, lbackstrom == lars2520 ?)
Re: error? (response to post by dskloet) | Reply
http://forums.topcoder.com/?module=Message&messageID=521130
Re: error? (response to post by dskloet) | Reply
You're right. When you take a dot product, you're basically using the fact that u ⋅ v = |u||v|cos(theta) where theta is the angle between the vectors (placed tail to tail). So if you think of AB as the vector (A-B) and BC as (B-C) then "angle between AB and BC" could be interpreted as "angle between the vectors when placed tail to tail," but since AB and BC are line segments with a common endpoint, there is a much more natural definition of "angle between" which corresponds to your interpretation.
Re: error? (response to post by Ryan) | Reply
Of course, silly me. I was thinking about BA ⋅ BC, I guess.
RSS