# Difference between randomGaussian() and nextGaussian()

**URL:** <https://discourse.processing.org/t/difference-between-randomgaussian-and-nextgaussian/14008>\
**Category:** Beginners\
**Created:** [September 16, 2019, 3:20am UTC](https://discourse.processing.org/t/difference-between-randomgaussian-and-nextgaussian/14008 "2019-09-16T03:20:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nzfs](https://avatars.discourse-cdn.com/v4/letter/n/a5b964/32.png) [@nzfs](https://discourse.processing.org/u/nzfs)\
**Post date:** [September 16, 2019, 3:20am UTC](https://discourse.processing.org/t/difference-between-randomgaussian-and-nextgaussian/14008/1 "2019-09-16T03:20:59Z")

</div>

is there a difference between the randomGaussian() function in processing, and the nextGaussian() in the java.util class?

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [September 16, 2019, 4:33am UTC](https://discourse.processing.org/t/difference-between-randomgaussian-and-nextgaussian/14008/2 "2019-09-16T04:33:03Z")

</div>

see  
[https://github.com/processing/processing/blob/master/core/src/processing/core/PApplet.java#L5149](https://github.com/processing/processing/blob/master/core/src/processing/core/PApplet.java#L5149) ,

also what did your read or try already:

```auto
// https://discourse.processing.org/t/difference-between-randomgaussian-and-nextgaussian/14008
// https://processing.org/reference/randomGaussian_.html
// https://www.tutorialspoint.com/java/util/random_nextgaussian.htm
// https://www.tutorialspoint.com/java/util/java_util_random.htm

import java.util.*;
Random randomno = new Random();
float x, y;

void setup() {
  background(200,200,0);
  stroke(200,0,0);
}

void draw() {
  translate( width/2, height/2);
  x = (float)randomno.nextGaussian();
  y = randomGaussian();
  point(10*x, 10*y);
}

```

so the difference actually is the double / float default usage of JAVA / Processing

---

<div class="post-metadata">

**Author:** ![nzfs](https://avatars.discourse-cdn.com/v4/letter/n/a5b964/32.png) [@nzfs](https://discourse.processing.org/u/nzfs)\
**Post date:** [September 18, 2019, 1:43am UTC](https://discourse.processing.org/t/difference-between-randomgaussian-and-nextgaussian/14008/3 "2019-09-18T01:43:32Z")

</div>

thank you! that cleared things out
