Skip to content

Commit

Permalink
Sync
Browse files Browse the repository at this point in the history
  • Loading branch information
Theo Martos committed Jan 8, 2019
1 parent 6feba8b commit 7329d89
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 6 deletions.
Binary file added Documentation/.DS_Store
Binary file not shown.
20 changes: 17 additions & 3 deletions FractionRationnelle.cc
Expand Up @@ -46,8 +46,6 @@ FractionRationnelle::FractionRationnelle(Polynome numerateur, Polynome denominat
coefs.push_back(Y.passage_base_bernstein());
coefs.push_back(Z.passage_base_bernstein());

cout << coefs.size() << endl;

for(int i = 0; i <= degre_max; i++)
m_points_controle.push_back(PointMassique(coefs[0][i], coefs[1][i], coefs[2][i]));
}
Expand Down Expand Up @@ -97,6 +95,16 @@ void FractionRationnelle::trace_assymptotes() const
}
}

// double FractionRationnelle::w_f(double t) const
// {
// double res = 0;

// for(int i = 0; i < m_points_controle.size(); i++)
// {

// }
// }

void FractionRationnelle::trace_courbe() const
{
for(int i = 0; i < m_points_controle.size(); i++)
Expand All @@ -110,7 +118,11 @@ void FractionRationnelle::trace_courbe() const
// for(double t = 0.001; t < 1; t += 0.001)
// de_casteljau(m_points_controle[0], m_points_controle[1], m_points_controle[2], 0, t);

de_casteljau(m_points_controle[0], m_points_controle[1], m_points_controle[2]);
// de_casteljau(m_points_controle[0], m_points_controle[1], m_points_controle[2]);
int degre_max = (m_numerateur.get_degre() >= m_denominateur.get_degre() ? m_numerateur.get_degre() : m_denominateur.get_degre());

// for(int i = 0; i < degre_max; i++)

}

string FractionRationnelle::to_s() const
Expand All @@ -123,3 +135,5 @@ string FractionRationnelle::to_s() const

return resultat;
}


2 changes: 2 additions & 0 deletions FractionRationnelle.h
Expand Up @@ -23,6 +23,8 @@ class FractionRationnelle
void trace_courbe() const;
void affiche_points_controles() const;

double FractionRationnelle::w_f(double t) const;

// Méthodes d'affichage
std::string to_s() const;

Expand Down
Binary file modified OpenGL
Binary file not shown.
18 changes: 15 additions & 3 deletions OpenGL.cc
Expand Up @@ -211,15 +211,20 @@ void init()
Point O(0., 0.), I(1., 0.), J(0., 1.);
Segment abscisse(-1000000, 0, 1000000, 0), ordonnee(0, -1000000, 0, 1000000);

double num[] = {1, -4, -11, 16};
double num[] = {2, 0, -1};
double denom[] = {1, 2, -3};

Polynome numerateur(num, 4);
Polynome numerateur(num, 3);
Polynome denominateur(denom, 3);

FractionRationnelle F(numerateur, denominateur);

cout << F.to_s() << endl;
// PointMassique A(0, 0, 1);
// PointMassique B(2, -1, 0.);
// PointMassique C(2, -2, 1);
// PointMassique D(6, 1, 1);

// cout << F.to_s() << endl;

glNewList(1, GL_COMPILE_AND_EXECUTE); //liste numero 1
trace_point(O, 0., 0., 1., 15.); //O
Expand All @@ -237,6 +242,13 @@ void init()

glNewList(3, GL_COMPILE_AND_EXECUTE); //liste numero 3
F.trace_courbe();
// trace_point(A, 0, 0,0, 5);
// trace_point(B, 0, 0,0, 5);
// trace_point(C, 0, 0,0, 5);
// trace_point(D, 0, 0,0, 5);

// for(double t = 0.001; t < 1; t += 0.001)X
// de_casteljau(A, B, C, D);
glEndList();

cout << "\nDone." << endl;
Expand Down
1 change: 1 addition & 0 deletions Point.cc
Expand Up @@ -53,6 +53,7 @@ void Point::trace(double taille, double r, double g, double b) const
glBegin(GL_POINTS); // on trace un point
glVertex2f(x, y); // coordonnees du point
glEnd();

}

Point operator+(Point const &p1, Point const &p2)
Expand Down

0 comments on commit 7329d89

Please sign in to comment.