Path: news.mathworks.com!not-for-mail
From: "Adam Hall" <hallaj@goldmail.etsu.edu>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Line Intersection given Column Vectors - HELP!
Date: Thu, 1 Apr 2010 13:36:05 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 66
Message-ID: <hp27g5$n1p$1@fred.mathworks.com>
References: <hp0i41$9l3$1@fred.mathworks.com> <10f6f7d7-2053-40b5-923e-cd480ed8751f@u31g2000yqb.googlegroups.com> <344d07f6-2b34-47a1-8f79-95118f744362@q15g2000yqj.googlegroups.com> <hp0st1$5vm$1@fred.mathworks.com> <hp1dva$3gb$1@fred.mathworks.com>
Reply-To: "Adam Hall" <hallaj@goldmail.etsu.edu>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1270128965 23609 172.30.248.37 (1 Apr 2010 13:36:05 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 1 Apr 2010 13:36:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2250547
Xref: news.mathworks.com comp.soft-sys.matlab:622597

"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <hp1dva$3gb$1@fred.mathworks.com>...
> > > > > On Mar 31, 3:25 pm, "Adam Hall" <hal...@goldmail.etsu.edu> wrote:
> > > > > > %
> > > > > > % x(t1) = a(i) + t1(b(i) - a(i))     -inf < t1 < inf
> > > > > > % y(t2) = c(i) + t2(d(i) - c(i))     -inf < t2 < inf
> > > > > > %
> > > > > > % intersect. The points of intersection (u(i),v(i)) are returned in column
> > > > > > % n-vectors u and v.
> > > > > > %
> ..........
> > I'm about to give up...
> ---------------
>   Are you sure you've copied that problem correctly, Adam?  As it stands it makes absolutely no sense to me.  If parameters t1 and t2 are kept equal to a common variable t, the equations
> 
>  x = a(i) + t(b(i) - a(i))
>  y = c(i) + t(d(i) - c(i))
> 
> would represent a single line in the x,y plane for each given i as the t parameter varies over its infinite range.  When t = 0 then (x,y) is the point (a(i),c(i)) and when t = 1, (x,y) is (b(i),d(i)), so this line would run through these two points.  Where is there an intersection in this?  There is only one line for each value of i.  I can think of no reasonable interpretation of those two original equations that represents a pair of intersecting lines - not as you have given them.
> 
>   I think it is important that you get the description of a problem you pose to this group entirely accurate.  Otherwise you may not receive any effective help.  We may not solve your homework in its entirety for you, but you might receive some useful help on a problem if it is described correctly.
> 
> Roger Stafford

Just wanted to say Thanks to both you and Nathan for attempting to help me.
Yes the problem is written correctly, but I'm assuming that x and y would both represent the same f(x) function and t1 and t2 would both represent x...

As an example of what I think the problem wants, let's look at these vectors:

A=[1,2,3]
B=[3,5,2]
C=[2,3,1]
D=[1,1,8]

Then the equation of the lines would be:
f(x) = 2x + 1
g(x) = -1x + 2

f(x) = 3x + 2
g(x) = -2x + 3

f(x) = -1x + 3
g(x) = 7x + 1

And we can solve for the intersection points:

2x + 1 = -x + 2
3x = 1
x = 1/3
f(1/3) = 2(1/3) + 1 = 5/3

3x + 2 = -2x + 3
5x = 1
x = 1/5
f(1/5) = 3(1/5) + 2 = 13/5

-1x + 3 = 7x + 1
8x = 2
x = 1/4
f(1/4) = -1(1/4) + 3 = 11/4

And our u and v would be:

u = [ 1/3, 1/5, 1/4 ]
v = [ 5/3, 13/5, 11/4 ]

The deadline for this problem was midnight last night, but if you guys would still like to help me figure it out, I wouldn't mind. I don't like not being able to figure things out, especially when the problem shouldn't be as difficult as it is...