Main Page   Namespace List   Compound List   File List   Compound Members   File Members  

vector.cpp

Go to the documentation of this file.
00001 #include <windows.h>
00002 #include "vector.h"
00003 #include "mmgr.h"
00004 
00005 VECTOR::VECTOR(float sx = 0.0, float sy = 0.0, float sz = 0.0)
00006 :
00007     x(sx),
00008     y(sy),
00009     z(sz)
00010 {
00011 }
00012 
00013 VECTOR::~VECTOR()
00014 {
00015 }
00016 
00017 void VECTOR::Reset()
00018 {
00019     x = 0.0;
00020     y = 0.0;
00021     z = 0.0;
00022 }
00023 
00024 float VECTOR::DotProduct(VECTOR vect)
00025 {
00026       float dot;
00027       dot = vect.x * x + vect.y * y + vect.z * z;
00028       return dot;
00029 }
00030 
00031 void VECTOR::CrossVector(VECTOR vect)
00032 {
00033       VECTOR temp = *this;
00034       x = vect.y * temp.z - vect.z * temp.y;
00035       y = vect.z * temp.x - vect.x * temp.z;
00036       z = vect.x * temp.y - vect.y * temp.x;
00037 }

Generated on Fri Dec 23 05:22:20 2005 for Template by doxygen1.2.15