Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using namespace std;
- class Vector
- {
- //float x_w_klasie;
- float x;
- float y;
- float z;
- public:
- //X
- void set_vectorX(float x){
- this->x = x;
- //x_w_klasie=x; Vector.set_vectorX(5);
- }
- float get_vectorX() const{
- return x;
- }
- //Y
- void set_vectorY(float y){
- this->y = y;
- }
- float get_vectorY() const{
- return y;
- }
- //Z
- void set_vectorZ(float z){
- this->z = z;
- }
- float get_vectorZ() const{
- return z;
- }
- Vector() : x(0), y(0), z(0){}
- //DEKLARACJE
- Vector(float x, float y, float z);
- Vector(const Vector& other);
- void print()
- {
- cout << "wektor x: " << x << " wektor y: " << y << " wektor z: " << z;
- }
- float module()
- {
- return sqrt((x*x) + (y*y) + (z*z));
- }
- };
- Vector::Vector(float x, float y, float z) : x(x), y(y), z(z)
- {}
- Vector::Vector(const Vector& other) : x(other.x), y(other.y), z(other.z)
- {}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement