Main Page | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

vec4.cpp File Reference


Detailed Description

Implementation of vector class.

#include "vec4.h"
#include <iostream>
#include <cstring>
#include <cmath>
#include "matrix4x4.h"

Include dependency graph for vec4.cpp:

Include dependency graph

Functions

Vec4 cross (Vec4 v1, Vec4 v2)
 Cross product operator.
float dot (Vec4 v1, Vec4 v2)
 Calculates the dot product.

Function Documentation

Vec4 cross Vec4  v1,
Vec4  v2
 

Cross product operator.

Calculates the normal vector to the plane described by the input vectors. Sets the fourth cell to zero as a cross product will never be a point.

Parameters:
v1 Input vector (3D).
v2 Input vector (3D).
Returns:
vector to complete right hand frame (or whatever).

float dot Vec4  v1,
Vec4  v2
 

Calculates the dot product.

We're ignoring the fourth cell for the moment. However, if code is written carefully enough, then it may be included again.


Generated on Mon Jan 3 15:14:19 2005 for Graviton by  doxygen 1.3.9.1