MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Linear algebra is a way to do it using Mma:
Define the unit direction vectors for the diagonal of a cube in a matrix d

d = {{1/Sqrt[3],1/Sqrt[3],1/Sqrt[3]},{-1/Sqrt[3],1/Sqrt[3],1/Sqrt[3]},{1/

Find the unit direction vector of your line if r = {r1,r2,r3} is 
the non-unit direction vector then
n = r/Sqrt[r.r]  will be the unit direction vector.

Then your diagonal angles are given by v = ArcCos[d.n//Simplify]

And finally the answer by Sum[Cos[v[[i]]]^2,{i,1,4}]//Simplify

Which will give you the simple fractional answer (that does not depend on 
n!!).  One doesn't actually need to go through all those computations but 
I did it that way to put it more closely into the form you requested.  
Hope that helps......regards,  RF

>>> Roland Bengtsson <d98rolb at> 02/17/99 10:33PM >>>

Let V1, V2, V3 and V4 be the angles that a given line create with
the diagonals in space in a cube. How can I calc the sum of:

(cos V1)^2 + (cos V2)^2 + (cos V3)^2 + (cos V4)^2

in Mathematica 3.0 or by hand?

All help appreciated!

  • Prev by Date: Re: Pure Functions in rules
  • Next by Date: RE: Mathematica vs. Executable code
  • Previous by thread: Linear algebra
  • Next by thread: Losing Mathematica password