# Earth to move in it's orbit

**URL:** <https://discourse.processing.org/t/earth-to-move-in-its-orbit/1379>\
**Category:** Coding Questions\
**Created:** [June 30, 2018, 8:17am UTC](https://discourse.processing.org/t/earth-to-move-in-its-orbit/1379 "2018-06-30T08:17:19Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)\
**Post date:** [June 30, 2018, 9:36am UTC](https://discourse.processing.org/t/earth-to-move-in-its-orbit/1379/2 "2018-06-30T09:36:42Z")

</div>

If you have an ellipse like this :

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/1X/abcf335d85ccfbb3b9ccf1300523c1b7fa9a8356.png)

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

![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/1X/ba0fc90b9c22dcada602c18d2f7dcb970e273e79.jpg)

Example :

```auto
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](https://en.wikipedia.org/wiki/Ellipse)

---

_[View the full topic](https://discourse.processing.org/t/earth-to-move-in-its-orbit/1379)._
