58 static double inf = 10000000;
61 static double ninf = -10000000;
129 for (
int i = 0; i < 3; i++)
134 cout <<
"error:zero vector cannnot be normalized";
145 double u[3] = { vec1.
getX(), vec1.
getY(), vec1.
getZ() };
147 return Vector3d(u[1] * v[2] - u[2] * v[1], u[2] * v[0] - u[0] * v[2], u[0] * v[1] - u[1] * v[0]);
153 double u[3] = { vec1.
getX(), vec1.
getY(), vec1.
getZ() };
155 return u[0] * v[0] + u[1] * v[1] + u[2] * v[2];
161 temp =
dot(vec1, vec2) / (vec1.
norm()*vec2.
norm());
180 double result[3] = { 0, 0, 0 };
181 for (
int i = 0; i < 3; i++)
183 for (
int j = 0; j < 3; j++)
185 result[i] += point[j] * (coord[i])[j];
193 double result[3] = { 0, 0, 0 };
194 for (
int i = 0; i < 3; i++)
196 for (
int j = 0; j < 3; j++)
198 result[i] += point[j] * (coord[i])[j];
202 point = point - origin;
Vector3d operator-(const Vector3d &b)
static double angle(Vector3d vec1, Vector3d vec2)
Vector3d(point start, point end)
Vector3d operator*(double k)
Vector3d operator+(const Vector3d &b)
GLboolean GLboolean GLboolean b
static void changeCoordinate(Vector3d &point, Vector3d coord[3])
static trimesh::Vec< D, T > abs(const trimesh::Vec< D, T > &v)
GLuint GLsizei GLsizei * length
GLdouble GLdouble GLdouble z
Vector3d(double x=0, double y=0, double z=0)
static double dot(Vector3d vec1, Vector3d vec2)
static Vector3d cross(Vector3d vec1, Vector3d vec2)