# How can i use this higher dimmensional equation in p5

decided to start a math script

x^2 + y^2 = 1

2 Likes

https://processing.org/reference/sq_.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

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

1 Like

heres a good example

``````<!DOCTYPE html>
<html>
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>
<body>
<div id="sketch-div"></div>
<p id="x-label"></p>
<p id="y-label"></p>
</body>
</html>
``````

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

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

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

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

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.

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

so that we see it like this:

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

…and not like this:

my code