cours_progra/bac1/q1/livres/ex_cpp/points.cpp

40 lines
461 B
C++
Raw Normal View History

2022-11-09 16:22:14 +01:00
#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);
}