Homepage Demos Overview Downloads Tutorials Reference
Credits
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages | Search

gvector.h File Reference


Detailed Description

vector class to aid in mathematical vector calculations

Author:
James R. Bruce (Creator)
  ========================================================================
    Vector.h : Simple vector class for 2D and 3D vectors
  ------------------------------------------------------------------------
    Copyright (C) 1999-2002  James R. Bruce
    School of Computer Science, Carnegie Mellon University
  ------------------------------------------------------------------------
    This software is distributed under the GNU General Public License,
    version 2.  If you do not have a copy of this licence, visit
    www.gnu.org, or write: Free Software Foundation, 59 Temple Place,
    Suite 330 Boston, MA 02111-1307 USA.  This program is distributed
    in the hope that it will be useful, but WITHOUT ANY WARRANTY,
    including MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
		========================================================================
 * 

Author
ejt
Name
tekkotsu-1_4_1
Revision
1.4
State
Exp
Date
2003/01/23 18:14:04

Definition in file gvector.h.

#include <math.h>
#include "Shared/Util.h"

Include dependency graph for gvector.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Namespaces

namespace  GVector

Defines

#define V3COMP(p)   p.x,p.y,p.z
#define V2COMP(p)   p.x,p.y
#define VECTOR3D_EQUAL_BINARY_OPERATOR(opr)
#define VECTOR3D_BINARY_OPERATOR(opr)
#define VECTOR3D_SCALAR_OPERATOR(opr)
#define VECTOR3D_EQUAL_SCALAR_OPERATOR(opr)
#define VECTOR3D_LOGIC_OPERATOR(opr, combine)
#define VECTOR2D_EQUAL_BINARY_OPERATOR(opr)
#define VECTOR2D_BINARY_OPERATOR(opr)
#define VECTOR2D_SCALAR_OPERATOR(opr)
#define VECTOR2D_EQUAL_SCALAR_OPERATOR(opr)
#define VECTOR2D_LOGIC_OPERATOR(opr, combine)


Define Documentation

#define V2COMP  )     p.x,p.y
 

Definition at line 23 of file gvector.h.

#define V3COMP  )     p.x,p.y,p.z
 

Definition at line 22 of file gvector.h.

#define VECTOR2D_BINARY_OPERATOR opr   ) 
 

Value:

template <class num> \
  vector2d<num> vector2d<num>::operator opr (const vector2d<num> p) const \
  {                  \
    vector2d<num> r; \
    r.x = x opr p.x; \
    r.y = y opr p.y; \
    return(r);       \
  }

#define VECTOR2D_EQUAL_BINARY_OPERATOR opr   ) 
 

Value:

template <class num> \
  vector2d<num> vector2d<num>::operator opr (const vector2d<num> p) \
  {                  \
    x = x opr p.x;   \
    y = y opr p.y;   \
    return(*this);   \
  }

Definition at line 466 of file gvector.h.

#define VECTOR2D_EQUAL_SCALAR_OPERATOR opr   ) 
 

Value:

template <class num> \
  vector2d<num> vector2d<num>::operator opr (num f) \
  {                \
    x = x opr f;   \
    y = y opr f;   \
    return(*this); \
  }

#define VECTOR2D_LOGIC_OPERATOR opr,
combine   ) 
 

Value:

template <class num> \
  bool vector2d<num>::operator opr (const vector2d<num> p) const \
  {                            \
    return((x opr p.x) combine \
           (y opr p.y));       \
  }

#define VECTOR2D_SCALAR_OPERATOR opr   ) 
 

Value:

template <class num> \
  vector2d<num> vector2d<num>::operator opr (const num f) const \
  {                  \
    vector2d<num> r;  \
    r.x = x opr f;   \
    r.y = y opr f;   \
    return(r);       \
  }

#define VECTOR3D_BINARY_OPERATOR opr   ) 
 

Value:

template <class num> \
  vector3d<num> vector3d<num>::operator opr (const vector3d<num> p) const \
  {                  \
    vector3d<num> r; \
    r.x = x opr p.x; \
    r.y = y opr p.y; \
    r.z = z opr p.z; \
    return(r);       \
  }

#define VECTOR3D_EQUAL_BINARY_OPERATOR opr   ) 
 

Value:

template <class num> \
  vector3d<num> vector3d<num>::operator opr (const vector3d<num> p) \
  {                  \
    x = x opr p.x;   \
    y = y opr p.y;   \
    z = z opr p.z;   \
    return(*this);   \
  }

Definition at line 170 of file gvector.h.

#define VECTOR3D_EQUAL_SCALAR_OPERATOR opr   ) 
 

Value:

template <class num> \
  vector3d<num> vector3d<num>::operator opr (num f) \
  {                \
    x = x opr f;   \
    y = y opr f;   \
    z = z opr f;   \
    return(*this); \
  }

#define VECTOR3D_LOGIC_OPERATOR opr,
combine   ) 
 

Value:

template <class num> \
  bool vector3d<num>::operator opr (const vector3d<num> p) const \
  {                            \
    return((x opr p.x) combine \
           (y opr p.y) combine \
           (z opr p.z));       \
  }

#define VECTOR3D_SCALAR_OPERATOR opr   ) 
 

Value:

template <class num> \
  vector3d<num> vector3d<num>::operator opr (const num f) const \
  {                  \
    vector3d<num> r; \
    r.x = x opr f;   \
    r.y = y opr f;   \
    r.z = z opr f;   \
    return(r);       \
  }

Tekkotsu v1.4
Generated Sat Jul 19 00:07:22 2003 by Doxygen 1.3.2