how do i find the position of a random object [on hold]












-1














I would like to know what I should write to get python to print out the vector position of the sphere labelled ball



import numpy as np
from vpython import sphere, vector, color, canvas,
from numpy import random
canvas(width = 640, height = 480,background=color.cyan)
ball=sphere(pos=vector(0,random.random(),0))









share|improve this question







New contributor




Sam Stakol is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











put on hold as unclear what you're asking by Divakar, pault, Nate, Tomasz Mularczyk, arghtype yesterday


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.




















    -1














    I would like to know what I should write to get python to print out the vector position of the sphere labelled ball



    import numpy as np
    from vpython import sphere, vector, color, canvas,
    from numpy import random
    canvas(width = 640, height = 480,background=color.cyan)
    ball=sphere(pos=vector(0,random.random(),0))









    share|improve this question







    New contributor




    Sam Stakol is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.











    put on hold as unclear what you're asking by Divakar, pault, Nate, Tomasz Mularczyk, arghtype yesterday


    Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.


















      -1












      -1








      -1







      I would like to know what I should write to get python to print out the vector position of the sphere labelled ball



      import numpy as np
      from vpython import sphere, vector, color, canvas,
      from numpy import random
      canvas(width = 640, height = 480,background=color.cyan)
      ball=sphere(pos=vector(0,random.random(),0))









      share|improve this question







      New contributor




      Sam Stakol is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I would like to know what I should write to get python to print out the vector position of the sphere labelled ball



      import numpy as np
      from vpython import sphere, vector, color, canvas,
      from numpy import random
      canvas(width = 640, height = 480,background=color.cyan)
      ball=sphere(pos=vector(0,random.random(),0))






      python numpy pycharm jupyter-notebook vpython






      share|improve this question







      New contributor




      Sam Stakol is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      Sam Stakol is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      Sam Stakol is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 2 days ago









      Sam Stakol

      11




      11




      New contributor




      Sam Stakol is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Sam Stakol is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Sam Stakol is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




      put on hold as unclear what you're asking by Divakar, pault, Nate, Tomasz Mularczyk, arghtype yesterday


      Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






      put on hold as unclear what you're asking by Divakar, pault, Nate, Tomasz Mularczyk, arghtype yesterday


      Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.


























          1 Answer
          1






          active

          oldest

          votes


















          0














          store it first outside the call to sphere:



          pos = random.random()
          ball = sphere(pos = vector(0,pos,0))
          print(pos)





          share|improve this answer




























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            store it first outside the call to sphere:



            pos = random.random()
            ball = sphere(pos = vector(0,pos,0))
            print(pos)





            share|improve this answer


























              0














              store it first outside the call to sphere:



              pos = random.random()
              ball = sphere(pos = vector(0,pos,0))
              print(pos)





              share|improve this answer
























                0












                0








                0






                store it first outside the call to sphere:



                pos = random.random()
                ball = sphere(pos = vector(0,pos,0))
                print(pos)





                share|improve this answer












                store it first outside the call to sphere:



                pos = random.random()
                ball = sphere(pos = vector(0,pos,0))
                print(pos)






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered yesterday









                Yishai E

                464




                464















                    Popular posts from this blog

                    Monofisismo

                    Angular Downloading a file using contenturl with Basic Authentication

                    Olmecas