-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplanetas.h
More file actions
40 lines (35 loc) · 1.01 KB
/
Copy pathplanetas.h
File metadata and controls
40 lines (35 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef PLANETAS_H
#define PLANETAS_H
#include <QGraphicsItem>
#include <QPainter>
#include <math.h>
#include <QDebug>
#define c_gra 1
#define g 1
#define es 0.04
class Planetas : public QGraphicsItem
{
private:
float Pposx,Pposy,Pvelx,Pvely,Pmasa,Pradio;
public:
float posx, posy,velx,vely, masa,Posx,Posy,Velx,Vely,Acelx,Acely;
Planetas();
Planetas(float x, float y, float vx, float vy, float m, float r);
float CalcularAcelx(Planetas *A);
float CalcularAcely(Planetas *A);
float CalcularVelx();
float CalcularVely();
void Modificar();
void ModValor();
void mover();
float getposx() ;
float getposy() ;
float getvelx() ;
float getvely() ;
float getmasa() ;
float getPosx();
float getPosy();
QRectF boundingRect() const; //necesario definirla, devuelve el rectangulo que encierra el objeto
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
};
#endif // PLANETAS_H