Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public enum Cialo {
- Sun (new Point(500, 500), 696342, new Color(255,200,0)),
- Mercury (Sun, 57909036.f, 2439, 0.241, new Color(225,190,150)),
- Venus (Sun, 108208925.f, 6051, 0.615, new Color(178,118,50)),
- Earth (Sun, 149597871.f, 6371, 1, new Color(60, 180,200)),
- Moon (Earth, 384400.f, 1736, 0.0748, new Color(200,200,200)),
- Mars (Sun, 227936637.f, 3389, 1.881, new Color(182,144,109)),
- Jupiter (Sun, 778412028.f, 70000, 11.862, new Color(226,203,159)),
- Saturn (Sun, 1473838225.f, 60000, 29.457, new Color(248,243,172)),
- Uran (Sun, 2872428721.f, 25362, 84.011, new Color(151,188,208)),
- Neptun (Sun, 4494967229.f, 24662, 164.69, new Color(97, 138,211)),
- Ceres (Sun, 414082773.f, 945, 4.6054, new Color(158,151,156)),
- Pluto (Sun, 5906423142.f, 2370, 247.6, new Color(165,126,103)),
- Haumea (Sun, 6483571729.f, 1379, 285.3, new Color(203,203,203)),
- Eris (Sun, 10120295973.f, 2326, 556.4, new Color(214,212,225)),
- Makemake(Sun, 6845598576.f, 1500, 309.57, new Color(100,50, 40)),
- Ganymede(Jupiter, 1882700.f, 2410, 0.0457, Color.LIGHT_GRAY),
- Callisto(Jupiter, 1882700.f, 2410, 0.0457, Color.LIGHT_GRAY);
- Point position;
- boolean stationary;
- Cialo center;
- double orbit;
- double radius;
- double period;
- Color color;
- Cialo(Cialo center, double orbit, double radius, double period, Color color) {
- this.center = center;
- this.position = new Point();//center.getX()+orbit, center.getY());
- stationary = false;
- this.color = color;
- this.radius = Math.sqrt(radius) / 10;
- this.orbit = (Math.log10(orbit)-5.5)*100+this.radius;
- //this.orbit = (Math.sqrt(orbit)/50+(Math.log10(orbit)-5.5)*50)*0.33+this.radius;
- this.period = period * 365.256363004;
- }
- Cialo(Point position, double radius, Color color) {
- this.position = position;
- this.stationary = true;
- this.color = color;
- this.radius = Math.sqrt(radius) / 10;
- }
- void calcPosition(double angle) {
- if (stationary) return;
- angle = angle / period;
- position.setLocation(center.getX() + orbit * Math.sin(angle),
- center.getY() + orbit * Math.cos(angle));
- }
- public int getX() {
- return (int) position.getX();
- }
- public int getY() {
- return (int) position.getY();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement