Skip to content

Commit e723802

Browse files
committed
betatron fixed + shift+click to emulate right click
1 parent 6f68121 commit e723802

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

docs/content/fun/pushers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ scripts:
1616

1717
This demo tool allows you to integrate particle trajectories in the analytically prescribed electric and magnetic fields. You may vary the fields themselves below (fields can be non-uniform and even time-varying), inject particles of different charge-to-mass ratios (by either dragging on the screen or using an injector at the bottom), and pick different parameters of the simulation (like the integration timestep, and the algorithm). You may also visualize your fields by ticking the checkboxes next to the corresponding components (the colormap is automatically rescaled to accomodate for its dynamic range).
1818

19-
The tool uses natural units, in which $c = 1$, and all the particle velocities are four-velocities, i.e., $\bm{u}\equiv \gamma\bm{\beta}$. When dragging on the screen with the right click, the charge-to-mass for the injected particle is $q/m=1$ (red), while the right click injects a particle with $q/m=-1$ (blue). Electric and magnetic fields can be either picked from a limited number of presets using the dropdown, or you can type them in in a functional form (as a function of $x$, $y$, $z$ position and time, $t$) using the boxes below (the evaluator accepts all sorts of expressions outlined [here](https://github.com/silentmatt/expr-eval)).
19+
The tool uses natural units, in which $c = 1$, and all the particle velocities are four-velocities, i.e., $\bm{u}\equiv \gamma\bm{\beta}$. When dragging on the screen with the right click, the charge-to-mass for the injected particle is $q/m=1$ (red), while the right click (or shift + left click if you're using touchpad) injects a particle with $q/m=-1$ (blue). Electric and magnetic fields can be either picked from a limited number of presets using the dropdown, or you can type them in in a functional form (as a function of $x$, $y$, $z$ position and time, $t$) using the boxes below (the evaluator accepts all sorts of expressions outlined [here](https://github.com/silentmatt/expr-eval)).
2020

2121
<div id="pushers">
2222
<div id="configs" style="display: inline-block">

docs/js/scripts/pushers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ document.addEventListener(
3333
betatron: {
3434
plot: "bz",
3535
bz: "tanh(y / 0.5)",
36-
ey: " 0.1",
36+
ex: " 0.1",
3737
},
3838
gradb: {
3939
plot: "bz",
@@ -858,7 +858,7 @@ document.addEventListener(
858858
if (ghost_particle) return;
859859
ghost_particle = new GhostParticle(
860860
px2xy(new p5.Vector(ctx.mouseX, ctx.mouseY, 0)),
861-
ctx.mouseButton === ctx.LEFT ? 1 : -1,
861+
ctx.mouseButton === ctx.LEFT ? (ctx.keyIsDown(16) ? -1 : 1) : -1,
862862
);
863863
};
864864

0 commit comments

Comments
 (0)