Re: Solve + Vector Equations
- To: mathgroup at smc.vnet.net
- Subject: [mg68261] Re: Solve + Vector Equations
- From: Peter Pein <petsie at dordos.net>
- Date: Mon, 31 Jul 2006 03:45:14 -0400 (EDT)
- References: <eahsek$oor$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
caa0012 at unt.edu schrieb:
> Here's an idea that would be convenient for future implementations of Solve
> Suppose v,w are vectors, a,b are points, and we want to know k,l
> scalars so that the following equation holds:
>
> v k + a = w l + b
>
> It's a bit irksome that I can't give the equation to Solve just like
> this, instead I have to define a transformation rule:
>
> Solve[
>
> v k + a = w l + b /. {x_,y_}=={w_,z_}:>{x==w,y==z} ,
>
> { k, l} ]
>
>
> Chris Arthur
>
Hi Chris,
use Thread[]!
In[1]:=
v = {v1, v2};
w = {w1, w2};
a = {a1, a2};
b = {b1, b2};
Map[Collect[#1, Flatten[{v, w}]] & ,
Solve[Thread[v*k + a == w*l + b], {k, l}],
-1]
Out[5]=
{{k -> -(((-a2 + b2)*w1 + (a1 - b1)*w2)/((-v2)*w1 + v1*w2)),
l -> -(((-a2 + b2)*v1 + (a1 - b1)*v2)/((-v2)*w1 + v1*w2))
}}
Peter