Page MenuHomec4science

penduledesc.h
No OneTemporary

File Metadata

Created
Thu, Dec 5, 05:32

penduledesc.h

#ifndef PENDULEDESC_H
#define PENDULEDESC_H
#include "descriptors/oscillateur.h"
class PenduleDesc : public Oscillateur
{
double l[2];
double m[2];
double g;
public:
/* Constructors */
PenduleDesc(double l1, double l2, double m1, double m2,
const Vector& p, const Vector& pp, double g = 9.81);
PenduleDesc(double l1, double l2, double m1, double m2,
const std::vector<double>& p, const std::vector<double>& pp, double g = 9.81);
/* set methods, index can be 0 or 1 */
void setAngle(double l, int index);
void setAngularSpeed(double l, int index);
void setLength(double l, int index);
void setMass(double m, int index);
void setGravity(double);
/* get methods */
double getLength(int index) const;
double getMass(int index) const;
double getAngle(int index) const;
double getAngularSpeed(int index) const;
double getGravity() const;
//retourne l'energie du système, utile pour le debugging
double energy() const;
protected:
/* equation override */
virtual Vector equation() const override;
};
#endif // PENDULEDESC_H

Event Timeline