Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //============================================================================
- // Name : point.cpp
- // Author : deloge
- // Version :
- // Copyright : Your copyright notice
- // Description : Hello World in C++, Ansi-style
- //============================================================================
- #include <iostream>
- using namespace std;
- #include "point.h";
- Point::Point(){
- x=0;
- y=0;
- }
- Point::Point(float xx,float yy){
- x=xx;
- y=yy;
- }
- float Point::getX(){
- return x;
- }
- float Point::getY(){
- return y;
- }
- void Point::setX(float xx){
- x=xx;
- }
- void Point::setY(float yy){
- y=yy;
- }
- Point Point::milieu(Point p1){
- Point p2;
- float x1,y1;
- x1=(x+p1.getX())/2;
- y1=(y+p1.getY())/2;
- p2.setX(x1);
- p2.setY(y1);
- return p2;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement