Skip to content

Commit

Permalink
Updated Rose Patterns and added a home page
Browse files Browse the repository at this point in the history
  • Loading branch information
AnadyaNair committed Oct 5, 2021
1 parent 1f3851a commit 9881503
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
3 changes: 3 additions & 0 deletions Rose Patterns/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 🔗 - [https://anadyanair.github.io/Creative-Coding/Rose%20Patterns/](https://anadyanair.github.io/Creative-Coding/Rose%20Patterns/)

Inspired by Coding Train Rose Pattern video.
2 changes: 1 addition & 1 deletion Rose Patterns/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
<script src="sketch.js"></script>
</head>
<body>

</body>
</html>
11 changes: 7 additions & 4 deletions Rose Patterns/sketch.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
var k = 4;

var k = 5/8;
var slider;
function setup(){
createCanvas(600, 600);
slider = createSlider(1,10,4,0.1);
}

function draw(){
k = slider.value();
background("#121212");
translate(width / 2, height / 2);

beginShape();
stroke(255);
noFill();
strokeWeight(1);

for (var a = 0; a < TWO_PI; a += 0.01){
var r = 200 * cos(7 * a);
for (var a = 0; a < TWO_PI * 10; a += 0.01){
var r = 200 * cos(k * a);
var x = r * cos(a);
var y = r * sin(a);
vertex(x,y);
Expand Down
13 changes: 13 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Anadya Nair - Creative Coding</title>
</head>
<body>
<h2>Preview of the programs.</h2>
<li><a href="https://anadyanair.github.io/Creative-Coding/Rose%20Patterns/">Rose Patterns</a></li>
</body>
</html>

0 comments on commit 9881503

Please sign in to comment.