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

Method setRandomVals

src/test/TextLayoutTest.java:57–67  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

55 }
56
57 public void setRandomVals() {
58 double[][][] data=griddata.getData();
59 double[][] dataR = data[0];
60 double r = Math.random();
61 for(int i=0; i<numpts; i++ ) {
62 for(int j=0; j<numpts; j++ ) {
63 dataR[i][j]=(r > 0.7 ? 255.0 * i/ numpts : r > 0.5 ? 255.0 * j /numpts : 255.0 * i/ numpts * j /numpts);
64 }
65 }
66 grayscalePlot.update();
67 }
68
69
70

Callers 1

drawMethod · 0.95

Calls 2

getDataMethod · 0.65
updateMethod · 0.65

Tested by

no test coverage detected