How can I put randomly eight vectors with length b into eight edges of a cube with side of a and specify them with their orientation relative to original frame. Suitable way is showing them by


i,j,k are unit vector in x,y,z directions and thetax,thetay and thetaz are relative angles of vectors to x,y,z axis respectively.

In this naming I am able to apply the main goal containing vector manipulations.

enter image description here

  • 1
    $\begingroup$ What do you want to do with those vectors? Further calculations? Display them only? $\endgroup$ – MarcoB Sep 12 '15 at 15:56

For view I would suggest the following:

b = 1;
a = 2;
cor = Tuples[{0, a}, 3];
arrwos = {#1 - #2, #1 + #2} & @@@ 
   Transpose[{cor, b/2 Normalize /@ RandomReal[{-1, 1}, {8, 3}]}];
   Cuboid[{0, 0, 0}, {a, a, a}]}, {PointSize[0.02], Red, Point[cor]}, 
  Arrow /@ arrwos}, Boxed -> False, Axes -> True, 
 AxesOrigin -> {0, 0, 0}]

enter image description here

  • $\begingroup$ Wonderful and great. $\endgroup$ – Unbelievable Sep 13 '15 at 3:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.