THIS QUESTIONS IS SOLVED!
Hi I am very new to processing and am trying to do roughly the same [as this post (mod edit)], but the resources posted below are not helping me find the solution…
I am now drawing the circles in a different way, and they are not random as I would like them to be.
See here my code:
//Creative Challenge 1. Version 0.1
// Date: 04/10/2022
// Author: Taissia Visser
// Name: Dandelion
// Inspired by:
// core circle
int coreRadius = 90;
//dots to be drawn inside the core circle
int dotcoreRadius = 15;
int radius = 10;
void setup() {
size(1000, 1000);
background(255);
ellipseMode(CENTER);
}
void draw() {
pushMatrix();
translate(width/2, height/2);
fill(#E3E5C9);
ellipse(0, 0, coreRadius, coreRadius);
// first and second row of dotcircles in core
dotcore(30);
dotcore2(10);
popMatrix();
}
void dotcore(int radius) {
for (int degrees = 0; degrees < 360; degrees +=36) {
float angle = radians(degrees);
float dotXpos = (sin(angle)* radius);
float dotYpos = (cos(angle)* radius);
ellipse(dotXpos, dotYpos, dotcoreRadius, dotcoreRadius);
}
}
void dotcore2(int radius){
for(int degrees = 0; degrees < 360; degrees += 120) {
float angle = radians(degrees);
float dotXpos = (sin(angle)* radius);
float dotYpos = (cos(angle)* radius);
ellipse(dotXpos, dotYpos, dotcoreRadius, dotcoreRadius);
}
}
Is there anyone who could help me? I think I have to use an if statement here, and I would like to make it so that if the x and y coordinates of the smaller circle are within the bigger circle, it draws the ellipse, else not. I would like to fill the whole outer ellipse with smaller circles.
Besides I was wondering if it also possible to know the (x,y) coordinates of the random circles drawn?
Thanks!
Greetings Ties