moving files
This commit is contained in:
39
q1/livres/ex_cpp/points.cpp
Normal file
39
q1/livres/ex_cpp/points.cpp
Normal file
@ -0,0 +1,39 @@
|
||||
#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);
|
||||
}
|
Reference in New Issue
Block a user