cours_progra/q1/livres/ex_cpp/points.cpp
2023-02-15 13:40:50 +01:00

40 lines
461 B
C++

#include "points.h"
#include "math.h"
Points::Points(float m_x, float m_y)
: x(m_x), y(m_y){}
// SETTERS
void Points::deplace(float m_dx, float m_dy){
x += m_dx;
y += m_dy;
}
void Points::homothetie(float k){
x *= k;
y *= k;
}
void Points::rotation(float angle){
}
// GETTERS
float Points::abscisse(){
return x;
}
float Points::ordonnee(){
return y;
}
float Points::rho(){
return sqrt(x*x + y*y);
}
float Points::theta(){
return atan(y/x);
}