Vector.cpp
上传用户:lhwx1029
上传日期:2013-03-07
资源大小:1173k
文件大小:8k
- /** 3DGPL *************************************************
- * () *
- * Header for operations on vectors used by the ray *
- * tracer. *
- * *
- * Defines: *
- * V_zero Initialize a vector; *
- * V_vector_coordinates Set the vector's coordinates;*
- * V_vector_points Make a vector from points; *
- * V_set Copy a vector; *
- * V_multiply Multiply by a scalar; *
- * V_scalar_product Find a scalar product; *
- * V_vector_product Find a vector product; *
- * V_sum Sum two vectors; *
- * V_difference Compute difference; *
- * V_unit_vector Compute unit vector; *
- * V_plane Coeffs of a plane equation; *
- * V_vertex_on_plane Checks if in the plane. *
- * *
- * (c) 1995-98 Sergei Savchenko, (savs@cs.mcgill.ca) *
- **********************************************************/
- #include <math.h> /* sqrt */
- #include "vector.h" /* self definition */
- /**********************************************************
- * Initialize a vector to zero. *
- * *
- * RETURNS: Initializeed vector. *
- * -------- *
- **********************************************************/
- float *V_zero(float *vec)
- {
- //一个float型的指针和一个矢量有什么关系