Message Boards Message Boards

0
|
6648 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
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