#ifndef VECTOR3_HPP #define VECTOR3_HPP #include #include class Vector3 { private: float x_, y_, z_; public: Vector3(float x = 0, float y = 0, float z = 0) : x_(x), y_(y), z_(z) {} // Vector3(float x, float y, float z) : x_(x), y_(y), z_(z) {} // ������ float x() const { return x_; } float y() const { return y_; } float z() const { return z_; } // ����� Vector3 operator+(const Vector3& v) const; Vector3 operator-(const Vector3& v) const; Vector3 operator*(float s) const; Vector3 operator/(float s) const; Vector3 operator-() const; void setX(float x) { x_ = x; } void setY(float y) { y_ = y; } void setZ(float z) { z_ = z; } // �������� float dot(const Vector3& v) const; Vector3 cross(const Vector3& v) const; float norm() const; float normSquared() const; Vector3 normalized() const; // �Ƚ� bool operator==(const Vector3& v) const; bool operator!=(const Vector3& v) const; // ��� friend std::ostream& operator<<(std::ostream& os, const Vector3& v); }; // ��������������������ת�������޵����˹��ת��ʽ�� Vector3 rotateAroundAxis(const Vector3& v, const Vector3& axis, float angle); #endif