Another service from Omega

Finding Unit Directions


*****


Problem:


Find a unit vector that points in the direction of the vector,
v = i/2 + j/4



Solution:


First define i and j,

> i := vector([1,0]); j := vector([0,1]);

                                  i := [1, 0]

                                  j := [0, 1]

then define v in terms of i and j,

> v := (1/2)*i + (1/4)*j;

                              v := 1/2 i + 1/4 j

The answer is obtained by dividing v by its length,

> Sol := evalm(v/sqrt(dotprod(v,v)));

                                 [     1/2       1/2]
                          Sol := [2/5 5   , 1/5 5   ]

This can also be written as,

> [2,1]/'sqrt(5)';

                                    [2, 1]
                                    -------
                                    sqrt(5)

which is approximatly,

> evalf(%);

                          [.8944271912, .4472135956]

Link to the commands in this file
Carlos Rodriguez <carlos@math.albany.edu>
Last modified: Mon Jan 29 09:15:01 EST 2001