APS Excellence in Physics Education Award
November 2019

Education Prize Logo
Science SPORE Prize
November 2011

NSF Logo
The Open Source Physics Project is supported by NSF DUE-0442581.

variable size of particle set objects? post and replies

Return to the variable size of particle set objects? thread
Login to post to this thread

variable size of particle test objects?
David Joiner
6 Posts

Is it possible to use an array for the size of individual objects in a particle set in the 2-D drawing pane?

I'm creating a model of an n-body simulation with collisions, and would like to have merged objects appear larger based on their mass.


Replies to variable size of particle test objects?

Re: variable size of particle test objects? -
Francisco Esquembre
237 Posts

Yes, it is. Just link the Size X and Size Y properties to an array of doubles, each with the size for the corresponding object on the set. Then change the size programmatically to whatever you want.
That should do it.
Paco



OSP Projects:
Open Source Physics - EJS Modeling
Tracker
Physlet Physics
Physlet Quantum Physics
STP Book