This is the web version of EJS interface
EJS version 4.2
  1. CaptureTools=true
  2. DataTools=true
  3. LanguageTools=true
  4. DetectedFiles=./_data/paco.gif;
    NameValueTypeDimension
    NameValueTypeDimension

    Solve Equations

    Compute derived variables

    x= length*Math.sin(angle); y = -length*Math.cos(angle); vx = omega*length*Math.cos(angle); vy = omega*length*Math.sin(angle);
    Commet:Translate (angle, omega) into (x,y) coordinates
    public void reverseTime () { dt = -dt; }
    Commet:Changes the sign of the time step, thus reversing time evolution
    public void fpsSet () { _setFPS(fps); }
    public void newCenter () { length = Math.sqrt(x*x+y*y); omega = 0.0; angle = Math.asin(x/length); if (y>0) { angle = Math.PI-angle; if (angle>Math.PI) angle -= 2.0*Math.PI; } time = 0.0; _clearView(); }
    Commet:Compute angle from (x,y)
    public void newVelocity () { if (Math.abs(Math.cos(angle))>0.01) omega = vx/(length*Math.cos(angle)); else omega = vy/(length*Math.sin(angle)); }
    Commet:Compute omega from (vx,vy)
    EJSVIEW: Click link to view it's content
    Control variables:(testing)
    int,double,double
    title=Pendulum
    layout=border
    visible=true
    location=0,0
    size="345,482"
    position=south
    layout=border
    position=north
    layout=grid:0,2,0,0
    position=south
    layout=grid:2,2,0,0
    border=8,2,2,2
    position=center
    text=Play
    enabled=_isPaused
    action=_play()
    text=Pause
    enabled=_isPlaying
    action=_pause()
    text=Reset
    action=_reset()
    text=Reverse
    action=reverseTime()
    position=center
    variable=fps
    minimum=1
    maximum=25
    format=FPS = 0
    ticks=9
    ticksFormat=0
    action=fpsSet()
    position=center
    variable=gravity
    minimum=0.0
    maximum=20.0
    format=g=0.0;g=-0.0
    ticks=9
    ticksFormat=0.#
    variable=dt
    minimum=-0.2
    maximum=0.2
    format=dt=0.000;dt=-0.000
    ticks=9
    ticksFormat=0.#
    position=south
    layout=grid:0,2,0,0
    position=center
    variable=showVelocity
    selected=false
    text=Display Velocity
    position=east
    variable=showPlot
    selected=false
    text=Show Plot
    position=center
    autoscaleX=false
    autoscaleY=false
    minimumX=-1.2
    maximumX=1.2
    minimumY=-1.2
    maximumY=1.2
    square=false
    x=0.0
    y=0.0
    sizex=x
    sizey=y
    enabled=false
    style=SEGMENT
    color=blue
    x=x
    y=y
    sizex=0.2
    sizey=0.2
    enabled=true
    pressaction=_pause()
    dragaction=newCenter()
    action=_play()
    style=FILLED_CIRCLE
    elementposition=CENTERED
    color=blue
    x=x
    y=y
    sizex=vx
    sizey=vy
    scalex=0.1
    scaley=0.1
    visible=showVelocity
    enabled=true
    dragaction=newVelocity()
    action=_play()
    style=ARROW
    color=magenta
    x=0.0
    y=0.15
    enabled=false
    text=Center
    elementposition=CENTERED
    color=red
    font=Dialog,PLAIN,21
    layout=border
    visible=showPlot
    location=360,0
    size=444,249
    position=center
    autoscaleX=true
    autoscaleY=true
    title=Angle vs. Time
    titleX=time
    titleY=angle
    x=time
    y=angle
    maxpoints=200
    skippoints=0
    connected=true