Guest User

Untitled

a guest
Nov 16th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. #ifndef DISTANCIA_PUNTOS_H
  2. #define DISTANCIA_PUNTOS_H
  3.  
  4. class punto {
  5.  
  6. public:
  7. int resultado;
  8. punto();
  9. ~punto();
  10. double getpunto1();
  11. void setpunto1(double x1, double y1);
  12. int getpunto2();
  13. void setpunto2(double x2, double y2);
  14.  
  15. private:
  16. double x1, y1;
  17. double x2, y2;
  18. };
  19.  
  20.  
  21.  
  22. void punto:: setpunto2(double _x2, double _y2){
  23.  
  24. x2 = _x2;
  25. x2 = _y2;
  26. }
  27.  
  28. void punto :: setpunto1 (double _x1, double _y1){
  29.  
  30. x1 = _x1;
  31. y1 = _y1;
  32. }
  33.  
  34.  
  35. double punto:: setpunto1(double x1,double y1){
  36. double resultadosetpunto1;
  37. resultadosetpunto1= sqrt(pow(x2,2.0) - pow(x1,2.0))+(pow(y2,2.0)-pow(y1,2.0));
  38. return (resultadosetpunto1);
  39. }
  40.  
  41. #endif /*DISTANCIA_PUNTOS_H */
Add Comment
Please, Sign In to add comment