Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Mathematica question

  1. Jun 11, 2009 #1
    it could be stupid question for you...

    if I input

    Table[{x,-1,z},{x,0,6,1}]

    I can get {{0,-1,z},{1,-1,z},{2,-1,z},{3,-1,z},{4,-1,z},{5,-1,z},{6,-1,z}}

    is it possible to change the z value only...

    what I want to get is like

    {{0,-1,1},{1,-1,0},{2,-1,-1},{3,-1,-2},{4,-1,-3},{5,-1,-4},{6,-1,-5}}

    as long as it shows the results like this with simple expression, it will be helpfull

    have any idea?
     
  2. jcsd
  3. Jun 11, 2009 #2

    CompuChip

    User Avatar
    Science Advisor
    Homework Helper

    It looks like you want z to be equal to 1 - x.
    So how about

    Table[{x,-1,1-x},{x,0,6,1}]

    ?
     
  4. Jun 16, 2009 #3
    that is easy!!!
    great help

    In addition,

    I would like to get a resutls
    like this
    Graphics3D[{{RGBColor[1, 0, 0, .5],
    Sphere[#, 0.2] & /@
    Select[Table[{x, -1, 3 - x}, {x, -1, 3}],
    Mod[Total[#], 2] == 0 &]}, Text[{-1, -1, 4}, {-1, -1, 4}],
    Text[{0, -1, 3}, {0, -1, 3}], Text[{1, -1, 2}, {1, -1, 2}],
    Text[{2, -1, 1}, {2, -1, 1}], Text[{3, -1, 0}, {3, -1, 0}]}]

    is there anyway to simplify the Text part!!!!

    getting there!!!

    even there are many things to ask...

    I would like to sort it out myself first!!!

    thank you very much
     
  5. Jun 16, 2009 #4

    CompuChip

    User Avatar
    Science Advisor
    Homework Helper

    How about putting it in the table as well?


    Code (Text):
    Graphics3D[{
      {{RGBColor[1, 0, 0, .5], Sphere[#, 0.2]}, Text[#, #]} & /@
       Select[Table[{x, -1, 3 - x}, {x, -1, 3}], Mod[Total[#], 2] == 0 &]
      }]
     
  6. Jun 19, 2009 #5
    it is easy!!!
    fantastic!!!
    basically, I have tried to make wurtzite structure by using mathematica.
    I think that I have done it.
    here is the code which I have done (this the best results in my ability)
    is there any way to simplify this results


    Graphics3D[{

    (* the first layer of Ga atom *)

    {RGBColor[1, 0, 0, .5],
    Sphere[#, 0.2] & /@
    Select[Table[{x, -1, 1 - x}, {x, -1, 3, 1}],
    Mod[Total[#], 2] == 0 &]},
    {RGBColor[1, 0, 0, .5],
    Sphere[#, 0.2] & /@
    Select[Table[{x, 0, 0 - x}, {x, -1, 3, 1}],
    Mod[Total[#], 2] == 0 &]},
    {RGBColor[1, 0, 0, .5],
    Sphere[#, 0.2] & /@
    Select[Table[{x, 1, -1 - x}, {x, -1, 3, 1}],
    Mod[Total[#], 2] == 0 &]},
    {RGBColor[1, 0, 0, .5],
    Sphere[#, 0.2] & /@
    Select[Table[{x, 2, -2 - x}, {x, -1, 3, 1}],
    Mod[Total[#], 2] == 0 &]},
    {RGBColor[1, 0, 0, .5],
    Sphere[#, 0.2] & /@
    Select[Table[{x, 3, -3 - x}, {x, -1, 3, 1}],
    Mod[Total[#], 2] == 0 &]},

    (* the second layer of Ga atom in [0001] direction *)

    {RGBColor[1, 0, 0, .5],
    Sphere[#, 0.2] & /@
    Select[Table[{x, 0, 2 - x}, {x, -1, 3, 1}],
    Mod[Total[#], 2] == 0 &]},
    {RGBColor[1, 0, 0, .5],
    Sphere[#, 0.2] & /@
    Select[Table[{x, 1, 1 - x}, {x, -1, 3, 1}],
    Mod[Total[#], 2] == 0 &]},
    {RGBColor[1, 0, 0, .5],
    Sphere[#, 0.2] & /@
    Select[Table[{x, 2, 0 - x}, {x, -1, 3, 1}],
    Mod[Total[#], 2] == 0 &]},
    {RGBColor[1, 0, 0, .5],
    Sphere[#, 0.2] & /@
    Select[Table[{x, 3, -1 - x}, {x, -1, 3, 1}],
    Mod[Total[#], 2] == 0 &]},
    {RGBColor[1, 0, 0, .5],
    Sphere[#, 0.2] & /@
    Select[Table[{x, 4, -2 - x}, {x, -1, 3, 1}],
    Mod[Total[#], 2] == 0 &]},

    (* the third layer of Ga atom in [0001] direction *)

    {RGBColor[1, 0, 0, .5],
    Sphere[#, 0.2] & /@
    Select[Table[{x + 4/3, -1 + 4/3, 1 - x + 4/3}, {x, -1, 3, 1}],
    Mod[Total[#], 2] == 0 &]},
    {RGBColor[1, 0, 0, .5],
    Sphere[#, 0.2] & /@
    Select[Table[{x + 4/3, 0 + 4/3, 0 - x + 4/3}, {x, -1, 3, 1}],
    Mod[Total[#], 2] == 0 &]},
    {RGBColor[1, 0, 0, .5],
    Sphere[#, 0.2] & /@
    Select[Table[{x + 4/3, 1 + 4/3, -1 - x + 4/3}, {x, -1, 3, 1}],
    Mod[Total[#], 2] == 0 &]},
    {RGBColor[1, 0, 0, .5],
    Sphere[#, 0.2] & /@
    Select[Table[{x + 4/3, 2 + 4/3, -2 - x + 4/3}, {x, -1, 3, 1}],
    Mod[Total[#], 2] == 0 &]},
    {RGBColor[1, 0, 0, .5],
    Sphere[#, 0.2] & /@
    Select[Table[{x + 4/3, 3 + 4/3, -3 - x + 4/3}, {x, -1, 3, 1}],
    Mod[Total[#], 2] == 0 &]},

    (* the fourth layer of Ga atom in [0001] direction *)

    {RGBColor[1, 0, 0, .5],
    Sphere[#, 0.2] & /@
    Select[Table[{x + 4/3, 0 + 4/3, 2 - x + 4/3}, {x, -1, 3, 1}],
    Mod[Total[#], 2] == 0 &]},
    {RGBColor[1, 0, 0, .5],
    Sphere[#, 0.2] & /@
    Select[Table[{x + 4/3, 1 + 4/3, 1 - x + 4/3}, {x, -1, 3, 1}],
    Mod[Total[#], 2] == 0 &]},
    {RGBColor[1, 0, 0, .5],
    Sphere[#, 0.2] & /@
    Select[Table[{x + 4/3, 2 + 4/3, 0 - x + 4/3}, {x, -1, 3, 1}],
    Mod[Total[#], 2] == 0 &]},
    {RGBColor[1, 0, 0, .5],
    Sphere[#, 0.2] & /@
    Select[Table[{x + 4/3, 3 + 4/3, -1 - x + 4/3}, {x, -1, 3, 1}],
    Mod[Total[#], 2] == 0 &]},
    {RGBColor[1, 0, 0, .5],
    Sphere[#, 0.2] & /@
    Select[Table[{x + 4/3, 4 + 4/3, -2 - x + 4/3}, {x, -1, 3, 1}],
    Mod[Total[#], 2] == 0 &]},

    (* the fifth layer of Ga atom in [0001] direction *)

    {RGBColor[1, 0, 0, .5],
    Sphere[#, 0.2] & /@
    Select[Table[{(x + 4/3) + 4/3, (-1 + 4/3) + 4/3, (1 - x + 4/3) +
    4/3}, {x, -1, 3, 1}], Mod[Total[#], 2] == 0 &]},
    {RGBColor[1, 0, 0, .5],
    Sphere[#, 0.2] & /@
    Select[Table[{(x + 4/3) + 4/3, (0 + 4/3) + 4/3, (0 - x + 4/3) + 4/
    3}, {x, -1, 3, 1}], Mod[Total[#], 2] == 0 &]},
    {RGBColor[1, 0, 0, .5],
    Sphere[#, 0.2] & /@
    Select[Table[{(x + 4/3) + 4/3, (1 + 4/3) + 4/3, (-1 - x + 4/3) +
    4/3}, {x, -1, 3, 1}], Mod[Total[#], 2] == 0 &]},
    {RGBColor[1, 0, 0, .5],
    Sphere[#, 0.2] & /@
    Select[Table[{(x + 4/3) + 4/3, (2 + 4/3) + 4/3, (-2 - x + 4/3) +
    4/3}, {x, -1, 3, 1}], Mod[Total[#], 2] == 0 &]},
    {RGBColor[1, 0, 0, .5],
    Sphere[#, 0.2] & /@
    Select[Table[{(x + 4/3) + 4/3, (3 + 4/3) + 4/3, (-3 - x + 4/3) +
    4/3}, {x, -1, 3, 1}], Mod[Total[#], 2] == 0 &]},

    (* the first layer of N atom *)

    {RGBColor[1, 5, 4, .5],
    Sphere[#, 0.1] & /@
    Select[Table[{x + 1/2, -1 + 1/2, 1 - x + 1/2}, {x, -1, 3, 1}],
    Mod[Total[#], 2] == 1.5 &]},
    {RGBColor[1, 5, 4, .5],
    Sphere[#, 0.1] & /@
    Select[Table[{x + 1/2, 0 + 1/2, 0 - x + 1/2}, {x, -1, 3, 1}],
    Mod[Total[#], 2] == 1.5 &]},
    {RGBColor[1, 5, 4, .5],
    Sphere[#, 0.1] & /@
    Select[Table[{x + 1/2, 1 + 1/2, -1 - x + 1/2}, {x, -1, 3, 1}],
    Mod[Total[#], 2] == 1.5 &]},
    {RGBColor[1, 5, 4, .5],
    Sphere[#, 0.1] & /@
    Select[Table[{x + 1/2, 2 + 1/2, -2 - x + 1/2}, {x, -1, 3, 1}],
    Mod[Total[#], 2] == 1.5 &]},
    {RGBColor[1, 5, 4, .5],
    Sphere[#, 0.1] & /@
    Select[Table[{x + 1/2, 3 + 1/2, -3 - x + 1/2}, {x, -1, 3, 1}],
    Mod[Total[#], 2] == 1.5 &]},

    (* the second layer of N atom *)

    {RGBColor[1, 5, 4, .5],
    Sphere[#, 0.1] & /@
    Select[Table[{x + 1/2, 0 + 1/2, 2 - x + 1/2}, {x, -1, 3, 1}],
    Mod[Total[#], 2] == 1.5 &]},
    {RGBColor[1, 5, 4, .5],
    Sphere[#, 0.1] & /@
    Select[Table[{x + 1/2, 1 + 1/2, 1 - x + 1/2}, {x, -1, 3, 1}],
    Mod[Total[#], 2] == 1.5 &]},
    {RGBColor[1, 5, 4, .5],
    Sphere[#, 0.1] & /@
    Select[Table[{x + 1/2, 2 + 1/2, 0 - x + 1/2}, {x, -1, 3, 1}],
    Mod[Total[#], 2] == 1.5 &]},
    {RGBColor[1, 5, 4, .5],
    Sphere[#, 0.1] & /@
    Select[Table[{x + 1/2, 3 + 1/2, -1 - x + 1/2}, {x, -1, 3, 1}],
    Mod[Total[#], 2] == 1.5 &]},
    {RGBColor[1, 5, 4, .5],
    Sphere[#, 0.1] & /@
    Select[Table[{x + 1/2, 4 + 1/2, -2 - x + 1/2}, {x, -1, 3, 1}],
    Mod[Total[#], 2] == 1.5 &]},

    (* the third layer of N atom *)

    {RGBColor[1, 5, 4, .5],
    Sphere[#, 0.1] & /@
    Select[Table[{(x + 4/3) + 1/2, (-1 + 4/3) + 1/2, (1 - x + 4/3) +
    1/2}, {x, -1, 3, 1}], Mod[Total[#], 2] == 1.5 &]},
    {RGBColor[1, 5, 4, .5],
    Sphere[#, 0.1] & /@
    Select[Table[{(x + 4/3) + 1/2, (0 + 4/3) + 1/2, (0 - x + 4/3) + 1/
    2}, {x, -1, 3, 1}], Mod[Total[#], 2] == 1.5 &]},
    {RGBColor[1, 5, 4, .5],
    Sphere[#, 0.1] & /@
    Select[Table[{(x + 4/3) + 1/2, (1 + 4/3) + 1/2, (-1 - x + 4/3) +
    1/2}, {x, -1, 3, 1}], Mod[Total[#], 2] == 1.5 &]},
    {RGBColor[1, 5, 4, .5],
    Sphere[#, 0.1] & /@
    Select[Table[{(x + 4/3) + 1/2, (2 + 4/3) + 1/2, (-2 - x + 4/3) +
    1/2}, {x, -1, 3, 1}], Mod[Total[#], 2] == 1.5 &]},
    {RGBColor[1, 5, 4, .5],
    Sphere[#, 0.1] & /@
    Select[Table[{(x + 4/3) + 1/2, (3 + 4/3) + 1/2, (-3 - x + 4/3) +
    1/2}, {x, -1, 3, 1}], Mod[Total[#], 2] == 1.5 &]},

    (* the fourth layer of N atom *)

    {RGBColor[1, 5, 4, .5],
    Sphere[#, 0.1] & /@
    Select[Table[{(x + 4/3) + 1/2, (0 + 4/3) + 1/2, (2 - x + 4/3) + 1/
    2}, {x, -1, 3, 1}], Mod[Total[#], 2] == 1.5 &]},
    {RGBColor[1, 5, 4, .5],
    Sphere[#, 0.1] & /@
    Select[Table[{(x + 4/3) + 1/2, (1 + 4/3) + 1/2, (1 - x + 4/3) + 1/
    2}, {x, -1, 3, 1}], Mod[Total[#], 2] == 1.5 &]},
    {RGBColor[1, 5, 4, .5],
    Sphere[#, 0.1] & /@
    Select[
    Table[{(x + 4/3) + 1/2, (2 + 4/3) + 1/2, (0 - x + 4/3) + 1/
    2}, {x, -1, 3, 1}], Mod[Total[#], 2] == 1.5 &]},
    {RGBColor[1, 5, 4, .5],
    Sphere[#, 0.1] & /@
    Select[Table[{(x + 4/3) + 1/2, (3 + 4/3) + 1/2, (-1 - x + 4/3) +
    1/2}, {x, -1, 3, 1}], Mod[Total[#], 2] == 1.5 &]},
    {RGBColor[1, 5, 4, .5],
    Sphere[#, 0.1] & /@
    Select[Table[{(x + 4/3) + 1/2, (4 + 4/3) + 1/2, (-2 - x + 4/3) +
    1/2}, {x, -1, 3, 1}], Mod[Total[#], 2] == 1.5 &]},

    (* the fifth layer of N atom *)

    {RGBColor[1, 5, 4, .5],
    Sphere[#, 0.1] & /@
    Select[Table[{((x + 4/3) + 4/3) + 1/2, ((-1 + 4/3) + 4/3) + 1/
    2, ((1 - x + 4/3) + 4/3) + 1/2}, {x, -1, 3, 1}],
    Mod[Total[#], 2] == 1.5 &]},
    {RGBColor[1, 5, 4, .5],
    Sphere[#, 0.1] & /@
    Select[Table[{((x + 4/3) + 4/3) + 1/2, ((0 + 4/3) + 4/3) + 1/
    2, ((0 - x + 4/3) + 4/3) + 1/2}, {x, -1, 3, 1}],
    Mod[Total[#], 2] == 1.5 &]},
    {RGBColor[1, 5, 4, .5],
    Sphere[#, 0.1] & /@
    Select[
    Table[{((x + 4/3) + 4/3) + 1/2, ((1 + 4/3) + 4/3) + 1/
    2, ((-1 - x + 4/3) + 4/3) + 1/2}, {x, -1, 3, 1}],
    Mod[Total[#], 2] == 1.5 &]},
    {RGBColor[1, 5, 4, .5],
    Sphere[#, 0.1] & /@
    Select[Table[{((x + 4/3) + 4/3) + 1/2, ((2 + 4/3) + 4/3) + 1/
    2, ((-2 - x + 4/3) + 4/3) + 1/2}, {x, -1, 3, 1}],
    Mod[Total[#], 2] == 1.5 &]},
    {RGBColor[1, 5, 4, .5],
    Sphere[#, 0.1] & /@
    Select[Table[{((x + 4/3) + 4/3) + 1/2, ((3 + 4/3) + 4/3) + 1/
    2, ((-3 - x + 4/3) + 4/3) + 1/2}, {x, -1, 3, 1}],
    Mod[Total[#], 2] == 1.5 &]},
     
  7. Jun 19, 2009 #6
    that was too long
    so here is rest part of it
    just combine together!!!

    Thick,

    (*bonding between the first Ga atom layer and the first N atom in [
    0001] direction*)

    {RGBColor[0, 1, 0],
    Line[Table[{{x, -1, 1 - x}, {x + 1/2, -1 + 1/2,
    1 - x + 1/2}}, {x, -1, 3, 1}]]},

    {RGBColor[0, 1, 0],
    Line[Table[{{x, 0, 0 - x}, {x + 1/2, 0 + 1/2,
    0 - x + 1/2}}, {x, -1, 3, 1}]]},

    {RGBColor[0, 1, 0],
    Line[Table[{{x, 1, -1 - x}, {x + 1/2,
    1 + 1/2, -1 - x + 1/2}}, {x, -1, 3, 1}]]},

    {RGBColor[0, 1, 0],
    Line[Table[{{x, 2, -2 - x}, {x + 1/2,
    2 + 1/2, -2 - x + 1/2}}, {x, -1, 3, 1}]]},

    {RGBColor[0, 1, 0],
    Line[Table[{{x, 3, -3 - x}, {x + 1/2,
    3 + 1/2, -3 - x + 1/2}}, {x, -1, 3, 1}]]},

    (*bonding between the first Ga atom layer and the first N atom in [
    0001] direction*)

    {RGBColor[0, 1, 0],
    Line[Table[{{x, 0, 2 - x}, {x + 1/2, -1 + 1/2,
    1 - x + 1/2}}, {x, -1, 3, 1}]]},
    {RGBColor[0, 1, 0],
    Line[Table[{{x, 0, 2 - x}, {(x + 1/2) - 1, (-1 + 1/2) + 1,
    1 - x + 1/2}}, {x, 0, 3, 1}]]},
    {RGBColor[0, 1, 0],
    Line[Table[{{x, 0,
    2 - x}, {(x + 1/2) - 1, -1 + 1/2, (1 - x + 1/2) + 1}}, {x, 0,
    3, 1}]]},

    {RGBColor[0, 1, 0],
    Line[Table[{{x, 1, 1 - x}, {x + 1/2, 0 + 1/2,
    0 - x + 1/2}}, {x, -1, 3, 1}]]},
    {RGBColor[0, 1, 0],
    Line[Table[{{x, 1, 1 - x}, {(x + 1/2) - 1, (0 + 1/2) + 1,
    0 - x + 1/2}}, {x, 0, 3, 1}]]},
    {RGBColor[0, 1, 0],
    Line[Table[{{x, 1, 1 - x}, {(x + 1/2) - 1,
    0 + 1/2, (0 - x + 1/2) + 1}}, {x, 0, 3, 1}]]},

    {RGBColor[0, 1, 0],
    Line[Table[{{x, 2, 0 - x}, {x + 1/2,
    1 + 1/2, -1 - x + 1/2}}, {x, -1, 3, 1}]]},
    {RGBColor[0, 1, 0],
    Line[Table[{{x, 2,
    0 - x}, {(x + 1/2) - 1, (1 + 1/2) + 1, -1 - x + 1/2}}, {x, 0,
    3, 1}]]},
    {RGBColor[0, 1, 0],
    Line[Table[{{x, 2, 0 - x}, {(x + 1/2) - 1,
    1 + 1/2, (-1 - x + 1/2) + 1}}, {x, 0, 3, 1}]]},

    {RGBColor[0, 1, 0],
    Line[Table[{{x, 3, -1 - x}, {x + 1/2,
    2 + 1/2, -2 - x + 1/2}}, {x, -1, 3, 1}]]},
    {RGBColor[0, 1, 0],
    Line[Table[{{x,
    3, -1 - x}, {(x + 1/2) - 1, (2 + 1/2) + 1, -2 - x + 1/2}}, {x,
    0, 3, 1}]]},
    {RGBColor[0, 1, 0],
    Line[Table[{{x, 3, -1 - x}, {(x + 1/2) - 1,
    2 + 1/2, (-2 - x + 1/2) + 1}}, {x, 0, 3, 1}]]},

    {RGBColor[0, 1, 0],
    Line[Table[{{x, 4, -2 - x}, {x + 1/2,
    3 + 1/2, -3 - x + 1/2}}, {x, -1, 3, 1}]]},
    {RGBColor[0, 1, 0],
    Line[Table[{{x, 4, -2 - x}, {(x + 1/2) - 1,
    3 + 1/2, (-3 - x + 1/2) + 1}}, {x, 0, 3, 1}]]},

    (*bonding between the second Ga atom layer and the second N atom in \
    [0001] direction*)

    {RGBColor[0, 1, 0],
    Line[Table[{{x, 0, 2 - x}, {x + 1/2, 0 + 1/2,
    2 - x + 1/2}}, {x, -1, 3, 1}]]},

    {RGBColor[0, 1, 0],
    Line[Table[{{x, 1, 1 - x}, {x + 1/2, 1 + 1/2,
    1 - x + 1/2}}, {x, -1, 3, 1}]]},

    {RGBColor[0, 1, 0],
    Line[Table[{{x, 2, 0 - x}, {x + 1/2, 2 + 1/2,
    0 - x + 1/2}}, {x, -1, 3, 1}]]},

    {RGBColor[0, 1, 0],
    Line[Table[{{x, 3, -1 - x}, {x + 1/2,
    3 + 1/2, -1 - x + 1/2}}, {x, -1, 3, 1}]]},

    {RGBColor[0, 1, 0],
    Line[Table[{{x, 4, -2 - x}, {x + 1/2,
    4 + 1/2, -2 - x + 1/2}}, {x, -1, 3, 1}]]},

    (*bonding between the second N atom layer and the third Ga atom \
    layer in [0001] direction*)

    {RGBColor[0, 1, 0],
    Line[Table[{{x + 1/2, 0 + 1/2, 2 - x + 1/2}, {x + 4/3, -1 + 4/3,
    1 - x + 4/3}}, {x, -1, 3, 1}]]},
    {RGBColor[0, 1, 0],
    Line[Table[{{x + 1/2, 0 + 1/2,
    2 - x + 1/2}, {x + 4/3 - 1, (-1 + 4/3) +
    1, (1 - x + 4/3)}}, {x, 0, 3, 1}]]},
    {RGBColor[0, 1, 0],
    Line[Table[{{x + 1/2, 0 + 1/2,
    2 - x + 1/2}, {x + 4/3 - 1, -1 + 4/3, (1 - x + 4/3) + 1}}, {x,
    0, 3, 1}]]},

    {RGBColor[0, 1, 0],
    Line[Table[{{x + 1/2, 1 + 1/2, 1 - x + 1/2}, {x + 4/3, 0 + 4/3,
    0 - x + 4/3}}, {x, -1, 3, 1}]]},
    {RGBColor[0, 1, 0],
    Line[Table[{{x + 1/2, 1 + 1/2,
    1 - x + 1/2}, {x + 4/3 - 1, (0 + 4/3) + 1, (0 - x + 4/3)}}, {x,
    0, 3, 1}]]},
    {RGBColor[0, 1, 0],
    Line[Table[{{x + 1/2, 1 + 1/2, 1 - x + 1/2}, {x + 4/3 - 1,
    0 + 4/3, (0 - x + 4/3) + 1}}, {x, 0, 3, 1}]]},

    {RGBColor[0, 1, 0],
    Line[Table[{{x + 1/2, 2 + 1/2, 0 - x + 1/2}, {x + 4/3,
    1 + 4/3, -1 - x + 4/3}}, {x, -1, 3, 1}]]},
    {RGBColor[0, 1, 0],
    Line[Table[{{x + 1/2, 2 + 1/2,
    0 - x + 1/2}, {x + 4/3 - 1, (1 + 4/3) +
    1, (-1 - x + 4/3)}}, {x, 0, 3, 1}]]},
    {RGBColor[0, 1, 0],
    Line[Table[{{x + 1/2, 2 + 1/2, 0 - x + 1/2}, {x + 4/3 - 1,
    1 + 4/3, (-1 - x + 4/3) + 1}}, {x, 0, 3, 1}]]},

    {RGBColor[0, 1, 0],
    Line[Table[{{x + 1/2, 3 + 1/2, -1 - x + 1/2}, {x + 4/3,
    2 + 4/3, -2 - x + 4/3}}, {x, -1, 3, 1}]]},
    {RGBColor[0, 1, 0],
    Line[Table[{{x + 1/2,
    3 + 1/2, -1 - x + 1/2}, {x + 4/3 - 1, (2 + 4/3) +
    1, (-2 - x + 4/3)}}, {x, 0, 3, 1}]]},
    {RGBColor[0, 1, 0],
    Line[Table[{{x + 1/2, 3 + 1/2, -1 - x + 1/2}, {x + 4/3 - 1,
    2 + 4/3, (-2 - x + 4/3) + 1}}, {x, 0, 3, 1}]]},

    {RGBColor[0, 1, 0],
    Line[Table[{{x + 1/2, 4 + 1/2, -2 - x + 1/2}, {x + 4/3,
    3 + 4/3, -3 - x + 4/3}}, {x, -1, 3, 1}]]},
    {RGBColor[0, 1, 0],
    Line[Table[{{x + 1/2, 4 + 1/2, -2 - x + 1/2}, {x + 4/3 - 1,
    3 + 4/3, (-3 - x + 4/3) + 1}}, {x, 0, 3, 1}]]},

    (*bonding between the third Ga atom layer and the third N atom \
    layer in [0001] direction*)

    {RGBColor[0, 1, 0],
    Line[Table[{{x + 4/3, -1 + 4/3,
    1 - x + 4/3}, {(x + 4/3) + 1/2, (-1 + 4/3) + 1/
    2, (1 - x + 4/3) + 1/2}}, {x, -1, 3, 1}]]},

    {RGBColor[0, 1, 0],
    Line[Table[{{x + 4/3, 0 + 4/3,
    0 - x + 4/3}, {(x + 4/3) + 1/2, (0 + 4/3) + 1/
    2, (0 - x + 4/3) + 1/2}}, {x, -1, 3, 1}]]},

    {RGBColor[0, 1, 0],
    Line[Table[{{x + 4/3,
    1 + 4/3, -1 - x + 4/3}, {(x + 4/3) + 1/2, (1 + 4/3) + 1/
    2, (-1 - x + 4/3) + 1/2}}, {x, -1, 3, 1}]]},

    {RGBColor[0, 1, 0],
    Line[Table[{{x + 4/3,
    2 + 4/3, -2 - x + 4/3}, {(x + 4/3) + 1/2, (2 + 4/3) + 1/
    2, (-2 - x + 4/3) + 1/2}}, {x, -1, 3, 1}]]},

    {RGBColor[0, 1, 0],
    Line[Table[{{x + 4/3,
    3 + 4/3, -3 - x + 4/3}, {(x + 4/3) + 1/2, (3 + 4/3) + 1/
    2, (-3 - x + 4/3) + 1/2}}, {x, -1, 3, 1}]]},

    (*bonding between the fourth Ga atom layer and the third N atom \
    layer in [0001] direction*)

    {RGBColor[0, 1, 0],
    Line[Table[{{x + 4/3, 0 + 4/3,
    2 - x + 4/3}, {(x + 4/3) + 1/2, (-1 + 4/3) + 1/
    2, (1 - x + 4/3) + 1/2}}, {x, -1, 3, 1}]]},
    {RGBColor[0, 1, 0],
    Line[Table[{{x + 4/3, 0 + 4/3,
    2 - x + 4/3}, {((x + 4/3) + 1/2) - 1, ((-1 + 4/3) + 1/2) +
    1, (1 - x + 4/3) + 1/2}}, {x, 0, 3, 1}]]},
    {RGBColor[0, 1, 0],
    Line[Table[{{x + 4/3, 0 + 4/3,
    2 - x + 4/3}, {((x + 4/3) + 1/2) - 1, (-1 + 4/3) + 1/
    2, ((1 - x + 4/3) + 1/2) + 1}}, {x, 0, 3, 1}]]},

    {RGBColor[0, 1, 0],
    Line[Table[{{x + 4/3, 1 + 4/3,
    1 - x + 4/3}, {(x + 4/3) + 1/2, (0 + 4/3) + 1/
    2, (0 - x + 4/3) + 1/2}}, {x, -1, 3, 1}]]},
    {RGBColor[0, 1, 0],
    Line[Table[{{x + 4/3, 1 + 4/3,
    1 - x + 4/3}, {((x + 4/3) + 1/2) - 1, ((0 + 4/3) + 1/2) +
    1, (0 - x + 4/3) + 1/2}}, {x, 0, 3, 1}]]},
    {RGBColor[0, 1, 0],
    Line[Table[{{x + 4/3, 1 + 4/3,
    1 - x + 4/3}, {((x + 4/3) + 1/2) - 1, (0 + 4/3) + 1/
    2, ((0 - x + 4/3) + 1/2) + 1}}, {x, 0, 3, 1}]]},

    {RGBColor[0, 1, 0],
    Line[Table[{{x + 4/3, 2 + 4/3,
    0 - x + 4/3}, {(x + 4/3) + 1/2, (1 + 4/3) + 1/
    2, (-1 - x + 4/3) + 1/2}}, {x, -1, 3, 1}]]},
    {RGBColor[0, 1, 0],
    Line[Table[{{x + 4/3, 2 + 4/3,
    0 - x + 4/3}, {((x + 4/3) + 1/2) - 1, ((1 + 4/3) + 1/2) +
    1, (-1 - x + 4/3) + 1/2}}, {x, 0, 3, 1}]]},
    {RGBColor[0, 1, 0],
    Line[Table[{{x + 4/3, 2 + 4/3,
    0 - x + 4/3}, {((x + 4/3) + 1/2) - 1, (1 + 4/3) + 1/
    2, ((-1 - x + 4/3) + 1/2) + 1}}, {x, 0, 3, 1}]]},

    {RGBColor[0, 1, 0],
    Line[Table[{{x + 4/3,
    3 + 4/3, -1 - x + 4/3}, {(x + 4/3) + 1/2, (2 + 4/3) + 1/
    2, (-2 - x + 4/3) + 1/2}}, {x, -1, 3, 1}]]},
    {RGBColor[0, 1, 0],
    Line[Table[{{x + 4/3,
    3 + 4/3, -1 - x + 4/3}, {((x + 4/3) + 1/2) -
    1, ((2 + 4/3) + 1/2) + 1, (-2 - x + 4/3) + 1/2}}, {x, 0, 3,
    1}]]},
    {RGBColor[0, 1, 0],
    Line[Table[{{x + 4/3,
    3 + 4/3, -1 - x + 4/3}, {((x + 4/3) + 1/2) - 1, (2 + 4/3) + 1/
    2, ((-2 - x + 4/3) + 1/2) + 1}}, {x, 0, 3, 1}]]},

    {RGBColor[0, 1, 0],
    Line[Table[{{x + 4/3,
    4 + 4/3, -2 - x + 4/3}, {(x + 4/3) + 1/2, (3 + 4/3) + 1/
    2, (-3 - x + 4/3) + 1/2}}, {x, -1, 3, 1}]]},
    {RGBColor[0, 1, 0],
    Line[Table[{{x + 4/3,
    4 + 4/3, -2 - x + 4/3}, {((x + 4/3) + 1/2) - 1, (3 + 4/3) + 1/
    2, ((-3 - x + 4/3) + 1/2) + 1}}, {x, 0, 3, 1}]]},

    (*bonding between the fourth Ga atom layer and the fourth N atom in \
    [0001] direction*)

    {RGBColor[0, 1, 0],
    Line[Table[{{x + 4/3, 0 + 4/3,
    2 - x + 4/3}, {(x + 4/3) + 1/2, (0 + 4/3) + 1/
    2, (2 - x + 4/3) + 1/2}}, {x, -1, 3, 1}]]},

    {RGBColor[0, 1, 0],
    Line[Table[{{x + 4/3, 1 + 4/3,
    1 - x + 4/3}, {(x + 4/3) + 1/2, (1 + 4/3) + 1/
    2, (1 - x + 4/3) + 1/2}}, {x, -1, 3, 1}]]},

    {RGBColor[0, 1, 0],
    Line[Table[{{x + 4/3, 2 + 4/3,
    0 - x + 4/3}, {(x + 4/3) + 1/2, (2 + 4/3) + 1/
    2, (0 - x + 4/3) + 1/2}}, {x, -1, 3, 1}]]},

    {RGBColor[0, 1, 0],
    Line[Table[{{x + 4/3,
    3 + 4/3, -1 - x + 4/3}, {(x + 4/3) + 1/2, (3 + 4/3) + 1/
    2, (-1 - x + 4/3) + 1/2}}, {x, -1, 3, 1}]]},

    {RGBColor[0, 1, 0],
    Line[Table[{{x + 4/3,
    4 + 4/3, -2 - x + 4/3}, {(x + 4/3) + 1/2, (4 + 4/3) + 1/
    2, (-2 - x + 4/3) + 1/2}}, {x, -1, 3, 1}]]},

    (*bonding between the fourth N atom layer and the fifth Ga atom \
    layer in [0001] direction*)

    {RGBColor[0, 1, 0],
    Line[Table[{{(x + 4/3) + 1/2, (0 + 4/3) + 1/2, (2 - x + 4/3) + 1/
    2}, {(x + 4/3) + 4/3, (-1 + 4/3) + 4/3, (1 - x + 4/3) + 4/
    3}}, {x, -1, 3, 1}]]},
    {RGBColor[0, 1, 0],
    Line[Table[{{(x + 4/3) + 1/2, (0 + 4/3) + 1/2, (2 - x + 4/3) + 1/
    2}, {((x + 4/3) + 4/3) - 1, ((-1 + 4/3) + 4/3) +
    1, (1 - x + 4/3) + 4/3}}, {x, 0, 3, 1}]]},
    {RGBColor[0, 1, 0],
    Line[Table[{{(x + 4/3) + 1/2, (0 + 4/3) + 1/2, (2 - x + 4/3) + 1/
    2}, {((x + 4/3) + 4/3) - 1, (-1 + 4/3) + 4/
    3, ((1 - x + 4/3) + 4/3) + 1}}, {x, 0, 3, 1}]]},

    {RGBColor[0, 1, 0],
    Line[Table[{{(x + 4/3) + 1/2, (1 + 4/3) + 1/2, (1 - x + 4/3) + 1/
    2}, {(x + 4/3) + 4/3, (0 + 4/3) + 4/3, (0 - x + 4/3) + 4/
    3}}, {x, -1, 3, 1}]]},
    {RGBColor[0, 1, 0],
    Line[Table[{{(x + 4/3) + 1/2, (1 + 4/3) + 1/2, (1 - x + 4/3) + 1/
    2}, {((x + 4/3) + 4/3) - 1, ((0 + 4/3) + 4/3) +
    1, (0 - x + 4/3) + 4/3}}, {x, 0, 3, 1}]]},
    {RGBColor[0, 1, 0],
    Line[Table[{{(x + 4/3) + 1/2, (1 + 4/3) + 1/2, (1 - x + 4/3) + 1/
    2}, {((x + 4/3) + 4/3) - 1, (0 + 4/3) + 4/
    3, ((0 - x + 4/3) + 4/3) + 1}}, {x, 0, 3, 1}]]},

    {RGBColor[0, 1, 0],
    Line[Table[{{(x + 4/3) + 1/2, (2 + 4/3) + 1/2, (0 - x + 4/3) + 1/
    2}, {(x + 4/3) + 4/3, (1 + 4/3) + 4/3, (-1 - x + 4/3) + 4/
    3}}, {x, -1, 3, 1}]]},
    {RGBColor[0, 1, 0],
    Line[Table[{{(x + 4/3) + 1/2, (2 + 4/3) + 1/2, (0 - x + 4/3) + 1/
    2}, {((x + 4/3) + 4/3) - 1, ((1 + 4/3) + 4/3) +
    1, (-1 - x + 4/3) + 4/3}}, {x, 0, 3, 1}]]},
    {RGBColor[0, 1, 0],
    Line[Table[{{(x + 4/3) + 1/2, (2 + 4/3) + 1/2, (0 - x + 4/3) + 1/
    2}, {((x + 4/3) + 4/3) - 1, (1 + 4/3) + 4/
    3, ((-1 - x + 4/3) + 4/3) + 1}}, {x, 0, 3, 1}]]},

    {RGBColor[0, 1, 0],
    Line[Table[{{(x + 4/3) + 1/2, (3 + 4/3) + 1/2, (-1 - x + 4/3) + 1/
    2}, {(x + 4/3) + 4/3, (2 + 4/3) + 4/3, (-2 - x + 4/3) + 4/
    3}}, {x, -1, 3, 1}]]},
    {RGBColor[0, 1, 0],
    Line[Table[{{(x + 4/3) + 1/2, (3 + 4/3) + 1/2, (-1 - x + 4/3) + 1/
    2}, {((x + 4/3) + 4/3) - 1, ((2 + 4/3) + 4/3) +
    1, (-2 - x + 4/3) + 4/3}}, {x, 0, 3, 1}]]},
    {RGBColor[0, 1, 0],
    Line[Table[{{(x + 4/3) + 1/2, (3 + 4/3) + 1/2, (-1 - x + 4/3) + 1/
    2}, {((x + 4/3) + 4/3) - 1, (2 + 4/3) + 4/
    3, ((-2 - x + 4/3) + 4/3) + 1}}, {x, 0, 3, 1}]]},

    {RGBColor[0, 1, 0],
    Line[Table[{{(x + 4/3) + 1/2, (4 + 4/3) + 1/2, (-2 - x + 4/3) + 1/
    2}, {(x + 4/3) + 4/3, (3 + 4/3) + 4/3, (-3 - x + 4/3) + 4/
    3}}, {x, -1, 3, 1}]]},
    {RGBColor[0, 1, 0],
    Line[Table[{{(x + 4/3) + 1/2, (4 + 4/3) + 1/2, (-2 - x + 4/3) + 1/
    2}, {((x + 4/3) + 4/3) - 1, (3 + 4/3) + 4/
    3, ((-3 - x + 4/3) + 4/3) + 1}}, {x, 0, 3, 1}]]},

    (*bonding between the fifth Ga atom layer and the fifth N atom in [
    0001] direction*)

    {RGBColor[0, 1, 0],
    Line[Table[{{(x + 4/3) + 4/3, (-1 + 4/3) + 4/3, (1 - x + 4/3) + 4/
    3}, {((x + 4/3) + 4/3) + 1/2, ((-1 + 4/3) + 4/3) + 1/
    2, ((1 - x + 4/3) + 4/3) + 1/2}}, {x, -1, 3, 1}]]},

    {RGBColor[0, 1, 0],
    Line[Table[{{(x + 4/3) + 4/3, (0 + 4/3) + 4/3, (0 - x + 4/3) + 4/
    3}, {((x + 4/3) + 4/3) + 1/2, ((0 + 4/3) + 4/3) + 1/
    2, ((0 - x + 4/3) + 4/3) + 1/2}}, {x, -1, 3, 1}]]},

    {RGBColor[0, 1, 0],
    Line[Table[{{(x + 4/3) + 4/3, (1 + 4/3) + 4/3, (-1 - x + 4/3) + 4/
    3}, {((x + 4/3) + 4/3) + 1/2, ((1 + 4/3) + 4/3) + 1/
    2, ((-1 - x + 4/3) + 4/3) + 1/2}}, {x, -1, 3, 1}]]},

    {RGBColor[0, 1, 0],
    Line[Table[{{(x + 4/3) + 4/3, (2 + 4/3) + 4/3, (-2 - x + 4/3) + 4/
    3}, {((x + 4/3) + 4/3) + 1/2, ((2 + 4/3) + 4/3) + 1/
    2, ((-2 - x + 4/3) + 4/3) + 1/2}}, {x, -1, 3, 1}]]},

    {RGBColor[0, 1, 0],
    Line[Table[{{(x + 4/3) + 4/3, (3 + 4/3) + 4/3, (-3 - x + 4/3) + 4/
    3}, {((x + 4/3) + 4/3) + 1/2, ((3 + 4/3) + 4/3) + 1/
    2, ((-3 - x + 4/3) + 4/3) + 1/2}}, {x, -1, 3, 1}]]}

    }, ImageSize -> 600, Boxed -> False]
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Mathematica question
  1. Resistance Question (Replies: 2)

  2. Wiring Question (Replies: 1)

  3. Charges question (Replies: 1)

  4. Amplifiers question (Replies: 2)

Loading...