| 12345678910111213141516171819202122232425262728293031323334 |
- #ifndef VECTOR3_H
- #define VECTOR3_H
- #include <string>
- struct Vector3{
- float x = 0;
- float y = 0;
- float z = 0;
- Vector3(float x1, float y1, float z1) : x(x1), y(y1), z(z1)
- {}
- Vector3(){};
- Vector3(std::string x1, std::string y1, std::string z1):
- x(std::stof(x1)), y(std::stof(y1)), z(std::stof(z1))
- {}
- Vector3 operator-(Vector3 &rhs);
- Vector3& normalized();
- float length();
- Vector3 crossProduct(Vector3 &rhs);
- float dotProduct(Vector3 &rhs);
- void print();
- };
- #endif
|