# How can i use this higher dimmensional equation in p5

**URL:** <https://discourse.processing.org/t/how-can-i-use-this-higher-dimmensional-equation-in-p5/10285>\
**Category:** Coding Questions\
**Created:** [April 15, 2019, 3:29am UTC](https://discourse.processing.org/t/how-can-i-use-this-higher-dimmensional-equation-in-p5/10285 "2019-04-15T03:29:25Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![octaminotin](https://avatars.discourse-cdn.com/v4/letter/o/f475e1/32.png) [@octaminotin](https://discourse.processing.org/u/octaminotin)\
**Post date:** [April 15, 2019, 3:29am UTC](https://discourse.processing.org/t/how-can-i-use-this-higher-dimmensional-equation-in-p5/10285/1 "2019-04-15T03:29:25Z")

</div>

decided to start a math script

it reads

x^2 + y^2 = 1

---

<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:** [April 15, 2019, 4:11am UTC](https://discourse.processing.org/t/how-can-i-use-this-higher-dimmensional-equation-in-p5/10285/2 "2019-04-15T04:11:46Z")

</div>

in the reference please find  
[https://processing.org/reference/sq\_.html](https://processing.org/reference/sq_.html)  
[https://processing.org/reference/pow\_.html](https://processing.org/reference/pow_.html)  
add can use java math lib  
[https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html](https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html)

* * *

ok, for P5.js find reference here:  
[https://p5js.org/reference/#/p5/pow](https://p5js.org/reference/#/p5/pow)

---

<div class="post-metadata">

**Author:** ![octaminotin](https://avatars.discourse-cdn.com/v4/letter/o/f475e1/32.png) [@octaminotin](https://discourse.processing.org/u/octaminotin)\
**Post date:** [April 15, 2019, 6:21am UTC](https://discourse.processing.org/t/how-can-i-use-this-higher-dimmensional-equation-in-p5/10285/5 "2019-04-15T06:21:52Z")

</div>

heres a good example

```auto
<!DOCTYPE html>
<html>
	<head>
		title>
    <script </script>
    
    <script>
      function updateLabels(x, y){
        var xLabel = document.getElementById('x-label');
        xLabel.innerHTML = 'X: ' + x;
        
        var yLabel = document.getElementById('y-label');
        yLabel.innerHTML = 'Y: ' + y;
      }
    </script>
		
		<script>
			function setup(){
				var canvas = createCanvas(200, 200);
        canvas.parent('sketch-div');
			}
			
			function draw(){
        background(32);
				fill(255);
				ellipse(mouseX, mouseY, 20, 20);
        
        updateLabels(mouseX, mouseY);
			}
		</script>
	</head>
	<body>
    <div id="sketch-div"></div>
    <p id="x-label"></p>
    <p id="y-label"></p>
	</body>
</html>

```

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [April 15, 2019, 8:00am UTC](https://discourse.processing.org/t/how-can-i-use-this-higher-dimmensional-equation-in-p5/10285/6 "2019-04-15T08:00:17Z")

</div>

I this a graphic for 2D or for 3D ?

---

<div class="post-metadata">

**Author:** ![octaminotin](https://avatars.discourse-cdn.com/v4/letter/o/f475e1/32.png) [@octaminotin](https://discourse.processing.org/u/octaminotin)\
**Post date:** [April 15, 2019, 9:36pm UTC](https://discourse.processing.org/t/how-can-i-use-this-higher-dimmensional-equation-in-p5/10285/7 "2019-04-15T21:36:05Z")

</div>

two d first its supposed to be a circle centered on a x and y axis like they example.

---

<div class="post-metadata">

**Author:** ![octaminotin](https://avatars.discourse-cdn.com/v4/letter/o/f475e1/32.png) [@octaminotin](https://discourse.processing.org/u/octaminotin)\
**Post date:** [April 16, 2019, 12:40am UTC](https://discourse.processing.org/t/how-can-i-use-this-higher-dimmensional-equation-in-p5/10285/8 "2019-04-16T00:40:02Z")

</div>

Research was done for this topic, for the shape lay out don’t forget the example in p5

---

<div class="post-metadata">

**Author:** ![octaminotin](https://avatars.discourse-cdn.com/v4/letter/o/f475e1/32.png) [@octaminotin](https://discourse.processing.org/u/octaminotin)\
**Post date:** [April 16, 2019, 1:16am UTC](https://discourse.processing.org/t/how-can-i-use-this-higher-dimmensional-equation-in-p5/10285/9 "2019-04-16T01:16:40Z")

</div>

![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/3/357bdbdce5a4db9bfda7b5d5210d5eddedb93285.png)

Heres a math equation displaying the universe in four-d it should show that there is something missing how can i enter this into a p5 physics generator of some sort

image collected from [https://www.google.com/search?rlz=1CAHJUL\_enUS820&ei=9Se1XJLYA8musAX94KDoBQ&q=dark+m+atter+equations&oq=dark+m+atter+equations&gs\_l=psy-ab.3..0i13j0i22i30l2.39748.47952..48186...1.0..2.163.5290.1j43](https://www.google.com/search?rlz=1CAHJUL_enUS820&ei=9Se1XJLYA8musAX94KDoBQ&q=dark+m+atter+equations&oq=dark+m+atter+equations&gs_l=psy-ab.3..0i13j0i22i30l2.39748.47952..48186...1.0..2.163.5290.1j43)…0…1…gws-wiz…6…0i71j35i39j0j0i131j0i67j0i10j0i8i13i30.eBpX0Ep8Ya0

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [April 20, 2019, 5:22pm UTC](https://discourse.processing.org/t/how-can-i-use-this-higher-dimmensional-equation-in-p5/10285/10 "2019-04-20T17:22:01Z")

</div>

Please format all code posts on the forum by either:

1. highlight your code and using the \</\> button

or

1. using three tick marks ``` before and after your code

When you type html and raw code in your posts, it breaks your posts.

Instead, do it like this:

````auto
```
<em>my code</em>
<iframe>
```

````

so that we see it like this:

```auto
<em>my code</em>
<iframe>

```

…and not like this:

_my code_
