-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVector3D.h
More file actions
30 lines (27 loc) · 739 Bytes
/
Vector3D.h
File metadata and controls
30 lines (27 loc) · 739 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef VECTOR3D_H
#define VECTOR3D_H
#include <iostream>
// #include "Point3D.h"
using namespace std;
class Vector3D
{
public:
double x, y, z;
public:
Vector3D();
Vector3D(double n);
Vector3D(const Vector3D &v);
Vector3D(double v_x, double v_y, double v_z);
Vector3D &operator=(const Vector3D &v);
Vector3D operator+(const Vector3D &v) const;
// Point3D operator+(const Point3D &p) const;
Vector3D operator-(const Vector3D &v) const;
Vector3D operator/(double number) const;
Vector3D operator*(double number) const;
friend Vector3D operator*(double number, const Vector3D &v);
double operator*(const Vector3D &v) const;
Vector3D operator^(const Vector3D &v) const;
Vector3D hat();
void show();
};
#endif