Below is my code to make a yin yang symbol but i want it to spin in one place can you have a look and give me a code to do so this was done on p5.js //This program is to explore variables to create a scalable shape like yin-yang. var diameter = 200; // for the diameter of the yin-yang. var centerX = 200; // the x-coordinate for the center of the yin-yang. var centerY = 200; // the y-coordinate for the center of the yin-yang. function setup() { createCanvas(400, 400); angleMode(DEGREES); } function draw() { background(130); // for background color. fill(0);// circle background color. ellipse(centerX, centerY, diameter + 0); fill(255); arc(centerX, centerY, diameter, diameter, 260, 80); noStroke(); ellipse(centerX, centerY - diameter / 4, diameter / 2); fill(0); // color for bottom black ellipse ellipse(centerX, centerY - diameter / 4, diameter / 4); ellipse(centerX, centerY + diameter / 4, diameter / 2); fill(255); // color for small white ellipse ellipse(centerX, centerY + diameter / 4, diameter / 4); } Subject: JAVA PROGRAMMING
Below is my code to make a yin yang symbol but i want it to spin in one place can you have a look and give me a code to do so
this was done on p5.js
//This program is to explore variables to create a scalable shape like yin-yang.
var diameter = 200; // for the diameter of the yin-yang.
var centerX = 200; // the x-coordinate for the center of the yin-yang.
var centerY = 200; // the y-coordinate for the center of the yin-yang.
function setup() {
createCanvas(400, 400);
angleMode(DEGREES);
}
function draw() {
background(130); // for background color.
fill(0);// circle background color.
ellipse(centerX, centerY, diameter + 0);
fill(255);
arc(centerX, centerY, diameter, diameter, 260, 80);
noStroke();
ellipse(centerX, centerY - diameter / 4, diameter / 2);
fill(0); // color for bottom black ellipse
ellipse(centerX, centerY - diameter / 4, diameter / 4);
ellipse(centerX, centerY + diameter / 4, diameter / 2);
fill(255); // color for small white ellipse
ellipse(centerX, centerY + diameter / 4, diameter / 4);
}
Subject: JAVA PROGRAMMING
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images