Earth to move in it's orbit


I have two ellipse.
one is larger ellipse and another is smaller ellipse.
i want smaller ellipse to follow the path of the larger ellipse. Your suggestions are needed?.
( i am a beginner).

If you have an ellipse like this :

You have the coordinates of your smaller ellipse with this formula :

image

Example :

float t = 0;
int a = 150;
int b = 100;

void setup(){
  size(400,400);
}


void draw(){
  background(255);
  translate(width/2,height/2);
  
  noFill();
  ellipse(0,0,a*2,b*2);
  
  fill(0,0,255);
  ellipse(a*cos(t),b*sin(t),10,10);
  
  t += 0.01;
}

You can find further informations on : https://en.wikipedia.org/wiki/Ellipse

1 Like

Thanks a lot for reply, with the suggestion you gave I successfully made whole solar system. However, all the planets are revolving with same speed. I want their speeds to be varied with each other. Your suggestion is required.

Just create separate variables for each planets :

float t_sun, t_venus, t_mars ...

And increment them differently.

My face detection is not working? Suggestion needed

Hey,

Can you post your code using <\> in the message editor and press Ctrl+T in the processing IDE ?
Don’t take pictures, take screenshots.

Is it necessary to install openCv to use openCv library for processing

Yes, go to Sketch > Import a library > Add a library > install OpenCV.

what is the meaning of
Client thisclient=myserver.available() ?

i am not getting the significance and meaning of available()

Go check out the documentation on the Network library (it is very helpful) :slight_smile: :