a few geometry questions...

James Spencer jspencer78 at mac.com
Sat Aug 6 22:27:30 EDT 2005


On Aug 6, 2005, at 8:53 PM, TJ Frame wrote:

> Hi everyone,
>  1) If I have the points A and B, how would I determine point C  
> that lies
> along the slope but is X units in length from the origin (which  
> will always
> be point A)
>  I can find the total distance between A and B or the midpoint  
> using the
> distance and midpoint formulas, but I'm not sure how to plug in a  
> specific
> distance value.

It's late and I'm fuzzy so I'm sure this can be optimized  
particularly as I'm not sure how good Rev is at geometric functions  
but without using them, given distance A to C is X assuming you have  
calculated that the distance from  A to B is Y and (continuing to use  
these letters as variable names)

put X / Y into tRatio
put tRatio * (item 1 of B - item 1 of A) into Cx
put tRatio * (item 2 of B - item 2 of A) into Cy
put Cx & comma & Cy into C

>  2) I also need to be able to find out where a circle of a given  
> radius
> whose orgin is at A intersects that imaginary line. Given that A  
> will always
> be the origin of the circle and I only want the single intersection  
> heading
> towards point B I wouldn't need to check for all possible solutions  
> such as
> non-intersection etc.

This is exactly the same problem as 1).  Just substitute the radius  
of the circle for distance X

James P. Spencer
Rochester, MN

jspencer78 at charter.net

"Badges??  We don't need no stinkin badges!"



More information about the use-livecode mailing list