# Perturb the location of lattice points

I create a simple lattice structure by the following code:

SimCube = Normal@LatticeData["SimpleCubic", "Basis"]
Lat = Flatten[Table[i SimCube[[1]] + j SimCube[[2]] + k SimCube[[3]], {i, 0, 5}, {j, 0, 5}, {k, 0, 2}], 2];
Graphics3D[Map[Sphere[#, .2] &, #], Boxed -> True, Axes -> True,ImageSize -> 300] & /@ {Lat}


That gives me the above lattice picture.

However, I need to change the position of the lattice points randomly. It is like the lattice points start to oscillate around their original locations. Each of them needs to be transferred to a new point in a random direction.

• Bahar, welcome to mma.se! We suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign
– kglr
Commented Jan 17, 2018 at 1:59

Graphics3D[Map[Translate[Sphere[#, .2], RandomReal[{-1, 1}, 3]] &, Lat],
Boxed -> True, Axes -> True, ImageSize -> 300]


Manipulate[Graphics3D[
Map[Sphere[# (1 - t) + t RandomReal[{-1, 1}, 3], .2] &, Lat],
Boxed -> True, Axes -> True, ImageSize -> 300,
SphericalRegion -> True, PlotRange -> {{-6, 6}, {-6, 6}, {-6, 6}}],
{t, 0, 1}]


• Thank you so much. It works perfectly. Commented Jan 17, 2018 at 1:51
• @Bahar, my pleasure.
– kglr
Commented Jan 17, 2018 at 5:47