CodingTrain / CodingTrain/Suggestion-Box
[Quantum Continuum]: Non standard idea to draw a Circle
- Dominant language
- No language data
- Stars
- 570
- Forks
- 85
- PR merge metrics
- No merged PRs in 30d
Description
# Non standard idea to draw a Circle
## Algorithm formula
**Note: Clicking on image below will open a video on YouToBee.**
[](https://www.youtube.com/watch?v=cFFGDukiOkY)

**Note: Clicking on image below will open a video on YouToBee.**
[](https://www.youtube.com/watch?v=kDPch4SiYjM)
## Output result
1. [Demo - https://alpha.editor.p5js.org/full/H1ZcQ2alG](https://alpha.editor.p5js.org/full/H1ZcQ2alG)
1. [Source Code OnLine - https://alpha.editor.p5js.org/gvitalie/sketches/H1ZcQ2alG](https://alpha.editor.p5js.org/gvitalie/sketches/H1ZcQ2alG)

```javascript
// # sketch.js
function setup() {
createCanvas(windowWidth, windowHeight);
}
function draw() {
background(51);
stroke(120);
strokeWeight(3);
fill(100, 0, 0, 100);
let D = height/2;
translate(width/2 - D/2, height/2);
beginShape();
for(let i=0; i<=D; i++){
let x = i;
let y = D - x;
// point(x, -sqrt(x*y));
// point(x, sqrt(x*y));
vertex(x, -sqrt(x*y));
// vertex(x, sqrt(x*y));
}
endShape();
beginShape();
for(let i=0; i<=D; i++){
let x = i;
let y = D - x;
// point(x, -sqrt(x*y));
// point(x, sqrt(x*y));
// vertex(x, -sqrt(x*y));
vertex(x, sqrt(x*y));
}
endShape();
}
function windowResized(){
resizeCanvas(windowWidth, windowHeight);
}
function mousePressed(){
let fs = fullscreen();
fullscreen(!fs);
}
```
@shiffman :100:
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.