MCPcopy Create free account
hub / github.com/OpenSourcePhysics/osp / setXY

Method setXY

src/davidson/gr/ShellParticle.java:84–96  ·  view source on GitHub ↗
(double x, double y)

Source from the content-addressed store, hash-verified

82 }
83
84 @Override
85 public void setXY(double x, double y) {
86 double x0 = this.x, y0 = this.y; // save current value
87 super.setXY(x, y); // set value
88 double dx = this.x - x0, dy = this.y - y0;
89 for (int i = 0, n = cluster.size(); i < n; i++) {
90 AbstractTrajectory t = cluster.get(i);
91 if (t != this) {
92 t.setX(t.getX() + dx);
93 t.setY(t.getY() + dy);
94 }
95 }
96 }
97
98 /**
99 * Displays the shell particle's initial conditions in an editor.

Callers

nothing calls this directly

Calls 6

setXYMethod · 0.65
getMethod · 0.65
setXMethod · 0.65
getXMethod · 0.65
setYMethod · 0.65
getYMethod · 0.65

Tested by

no test coverage detected