Another service from Omega

Finding the sin of the angle between two vectors



Find sin(t) where t is the angle between v and w with,

> v := i+j; w := i+j+k;

                                  v := i + j

                                w := i + j + k


Here I am assuming that the maple session already knows about linalg and the vectors i,j and k. If you start a clean session without any pre-loading of anything then you MUST first load the linalg package with "with(linalg):" and then define i,j and k as "i := [1,0,0]" etc...


First define the length function as,

> len := vec -> sqrt(dotprod(vec,vec)):

and then get sin(t) from the geometric definition of the crossprod,

> sint := len(crossprod(v,w))/(len(v)*len(w));

                               sint := 1/3 3

this corresponds to an angle of,

> convert(angle(v,w),degrees);

                                       1/2  1/2
                           arccos(1/3 2    3   ) degrees
                       180 -----------------------------
> evalf(%);
                              35.26438968 degrees

Link to the commands in this file
Carlos Rodriguez <>
Last modified: Thu Sep 14 15:02:07 EDT 2000