Vector Class Reference

[krubik Index] [krubik Heirarchy]


General vector class More...

#include <vector.h>

Public Members


Detailed Description

This is the class Vector. It represents a general (mathematical) vector. The class is used by krubik but is also usefull for other programs.


Vector()

Construct the zero-vector, with length 3.

Vector(int l)

Constructs a zero vector with specified length

Vector( double x, double y, double z)

Constructs a vector in R-3

Parameters:
x The x coordinate of the vector
y The y coordinate of the vector
z The z coordinate of the vector

void operator=(Vector v)

Overloaded operator=

See Also:
set

void operator=(Vector *v)

Overloaded operator=

See Also:
set

~Vector()

The destrucor method for class Vector

void set(double x, double y, double z)

Create is new vector with length 3 at values x, y, z

double get(int i)

Get value of vector at specified index

double& x()

Used for compatibility with old class Vector

double scalProd(Vector v)

Calculates the inner-produkt of the current vertor with the argument vector.

Parameters:
v The vector with which to take the innerproduct
Returns:
Returns the inner-product

double operator*( Vector v )

Overloaded operator *

See Also:
scalProd

void Normalize()

Normalizes the vector, that is multiplies the vector by the 1 over the norm of the vector.

double cosAngle(Vector v)

Calculates the angle between 2 vectors.

void scalMult( double s)

Calculate the scalar multiple of the argument with this vector.

Vector operator*( double s )

Overloaded operator *

See Also:
scalMult

void operator*=( double s )

Overloaded operator *=

See Also:
scalMult

Vector operator+(Vector v)

Overloaded operator +, does the same as the function addVec

See Also:
addVec

void operator+=(Vector v)

Overloaded operator +=

Vector operator-( Vector v )

Overloaded operator -

void operator-=(Vector v)

Overloaded operator -=

See Also:
subVec

void copyVec( Vector *v )

Overloaded function.

void vectorProd( Vector.html">Vector v, Vector.html">Vector w )

Calculates the cross-product of two vectors. Note : the vector produkt is only defines for two vector's of length 3.

Parameters:
v First vector to calculate cross-product
w Second vector

  • Author: Pieter Eendebak <pte@ddsw.nl>
  • Version: 0.4
  • Documentation generated by root@localhost.localdomain on Sat Jun 27 15:21:54 MET DST 1998
Kdoc