# random distribution vectors on cube edges

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={bcos[thetax]i+bcos[thetay]j+bcos[thetaz]k}
d={bcos[thetax]i+bcos[thetay]j+bcos[thetaz]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.

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

## 1 Answer

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,
Cuboid[{0, 0, 0}, {a, a, a}]}, {PointSize[0.02], Red, Point[cor]},
Arrow /@ arrwos}, Boxed -> False, Axes -> True,
AxesOrigin -> {0, 0, 0}] • Wonderful and great. – Unbelievable Sep 13 '15 at 3:38