I think the method would go something like this:

If you can get the endpoints then
    for line one x1,y1 and x2,y2
    for line two x3,y3 and x4,y4

The formula for a line is y=mx+c
where m is the gradient and c the point where the line crosses the y axis

i) determine the gradient for each of the two lineseg  m1=(x1-x2)/(y1-y2)
ii) place the value for m in the line equation and set y to 0, solving c
iii) you should now have an equation for each line
iv) where they intersect x and y are equal, so solve
m(line1)x+c(line1)=m(line2)x+c(line2) giving an x value.
v) replace the x value in one of the line formulas giving a value for y
vi) OPTIONAL - check the x value in iv) in the other line equation which
should give the same y result.
vii) you should now have an x,y value which is the point of intersection.


Gary Rathbone


on 10/10/00 16:14, Simon Lord at [EMAIL PROTECTED] wrote:

> Is there a way to get the point where two vector lines meet?  I don't see
> how since I can only get the end points, but maybe there's some magic I
> don't know about.
> 
> --
> 
> Cheers,
> Simon
> 
> Graphic Development: http://www.amigo-3.com
> 
> --------------------------------------------------
> "The great discoveries in science are not punctuated by 'Eureka! I've found
> it!' but rather "Hmmm,that's funny...." Isaac Asimov
> 
> 

Reply via email to