3
$\begingroup$

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

d[1]={bcos[thetax[1]]i+bcos[thetay[1]]j+bcos[thetaz[1]]k}
d[2]={bcos[thetax[2]]i+bcos[thetay[2]]j+bcos[thetaz[2]]k}
.
.
.

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

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

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}]}];
Graphics3D[{{Opacity[0], 
   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

$\endgroup$
  • $\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.