Message Boards Message Boards

0
|
6845 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Newbie question: how to solve for a given var in this set of equations

Posted 10 years ago

I have entered the following equations into Wolfram and it seems to understand them. I'd like to solve for t in terms of the other scalars:

  A={ax,ay}; B={bx,by}; C={cx,cy}; 
  B'=(A+C)/2+t*(B-(A+C)/2); 
  d=(A-B').(C-B')/(Norm[A-B']*Norm[C-B']

)

I've tried variations on the Solve[] command but I am not sure how to express this. I'm also curious as to why Wolfram always says that variable C is protected in the above.

thanks, Pat

POSTED BY: Pat Niemeyer
Posted 10 years ago

Try this

In[1]:= Avector = {ax, ay}; Bvector = {bx, by}; Cvector = {cx, cy};
Bvectorprime = (Avector + Cvector)/2 + t*(Bvector - (Avector + Cvector)/2);
d = (Avector - Bvectorprime).(Cvector - Bvectorprime)/(Norm[
      Avector - Bvectorprime]*Norm[Cvector - Bvectorprime]);
Solve[d == 0, t]

Out[4]= {
   {t -> -(Sqrt[ax^2 + ay^2 - 2 ax cx + cx^2 - 2 ay cy + cy^2])/(Sqrt[ax^2 + ay^2 - 4 ax bx + 4 bx^2 - 4 ay by + 
         4 by^2 + 2 ax cx - 4 bx cx + cx^2 + 2 ay cy - 4 by cy + cy^2])},
   {t -> (Sqrt[ax^2 + ay^2 - 2 ax cx + cx^2 - 2 ay cy + cy^2])/(Sqrt[ax^2 + ay^2 - 4 ax bx + 4 bx^2 - 4 ay by + 
        4 by^2 + 2 ax cx - 4 bx cx + cx^2 + 2 ay cy - 4 by cy + cy^2])}}

Many symbols are have predefined meaning within Mathematica. For example C and ' <-Click each of those to read the documentation.

POSTED BY: Bill Simpson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract