Advertisement
Guest User

Untitled

a guest
Nov 24th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. using namespace std;
  2.  
  3. class Vector
  4. {
  5. //float x_w_klasie;
  6. float x;
  7. float y;
  8. float z;
  9.  
  10. public:
  11.  
  12. //X
  13. void set_vectorX(float x){
  14. this->x = x;
  15. //x_w_klasie=x; Vector.set_vectorX(5);
  16. }
  17.  
  18. float get_vectorX() const{
  19. return x;
  20. }
  21.  
  22. //Y
  23. void set_vectorY(float y){
  24. this->y = y;
  25. }
  26.  
  27. float get_vectorY() const{
  28. return y;
  29. }
  30.  
  31. //Z
  32. void set_vectorZ(float z){
  33. this->z = z;
  34. }
  35.  
  36. float get_vectorZ() const{
  37. return z;
  38. }
  39.  
  40.  
  41. Vector() : x(0), y(0), z(0){}
  42. //DEKLARACJE
  43. Vector(float x, float y, float z);
  44. Vector(const Vector& other);
  45.  
  46. void print()
  47. {
  48. cout << "wektor x: " << x << " wektor y: " << y << " wektor z: " << z;
  49. }
  50.  
  51. float module()
  52. {
  53. return sqrt((x*x) + (y*y) + (z*z));
  54. }
  55.  
  56.  
  57.  
  58. };
  59.  
  60. Vector::Vector(float x, float y, float z) : x(x), y(y), z(z)
  61. {}
  62.  
  63. Vector::Vector(const Vector& other) : x(other.x), y(other.y), z(other.z)
  64. {}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement