Education Prize Logo
Science SPORE Prize
November 2011

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

how to draw polygon in EJSS models? post and replies

Return to the how to draw polygon in EJSS models? thread
Login to post to this thread

how to draw polygon in EJSS models? - Sep 24, 2013 at 3:39AM
lookang Avatar
lookang
80 Posts

dear EJS community,

how to draw polygon in EJSS models?




previously in EJS,
X Data = new double[] {-0.5, 0.5, 0}
Y Data = new double[] {0.0, 0.0, 1.0}

but in in EJSS, how do i define the points of the polygon?

Post edited September 24, 2013 at 3:39 AM EST.

Attached File: ejss_src_rockettemplatelookang.zip


http://weelookang.blogspot.sg

Replies to how to draw polygon in EJSS models?

Re: how to draw polygon in EJSS models? - Sep 24 2013 4:28AM
Francisco Esquembre
106 Posts

Define a double [3][2] array with the value:

[[-0.5,0.0],[0.5,0.0],[0.0,1.0]]

and then link it to the Points property of the polygon.

Or write the array directly into the Points property (if it is going to be constant).

Paco



Re: Re: how to draw polygon in EJSS models? - Sep 24 2013 5:38AM
lookang Avatar
lookang
80 Posts

awesome!
it works beautifully.

attached is my attempt on Prof Larry's Rocket Model Template.

i will be trying this out with about 10-20 grade 9 students in November 2013 http://www.hillgrovesec.moe.edu.sg/

Wohoo!
it will be fun :)

Attached File: ejss_model_rockettemplatelookang.zip


http://weelookang.blogspot.sg


Re: how to draw polygon in EJSS models? - Sep 24 2013 7:48AM
Wolfgang
66 Posts

The Half Atwood Machine JavaScript model uses a polygon.

http://www.compadre.org/osp/items/detail.cfm?ID=12976



The OSP Network:
Open Source Physics - Tracker - EJS Modeling
Physlet Physics
Physlet Quantum Physics