KudanCV
KudanVector3 Class Reference

#include <KudanCV.h>

Public Member Functions

 KudanVector3 ()
 
 KudanVector3 (float x, float y, float z)
 
void zero ()
 
KudanVector3 add (KudanVector3 vec)
 
KudanVector3 operator+ (KudanVector3 vec)
 
KudanVector3 subtract (KudanVector3 vec)
 
KudanVector3 operator- (KudanVector3 vec)
 
KudanVector3 multiply (float scalar)
 
KudanVector3 operator* (float scalar)
 
float norm ()
 
std::string toString ()
 

Data Fields

float x
 
float y
 
float z
 

Detailed Description

Simple representation of a 3D point or vector.

Constructor & Destructor Documentation

Default constructor initialises the data to the zero vector (0,0,0)'

KudanVector3 ( float  x,
float  y,
float  z 
)

Constructor for initialising the data to the given vector

Parameters
x,y,zCoefficients of the vector

Member Function Documentation

KudanVector3 add ( KudanVector3  vec)

Add this to another 3x1 vector

Parameters
vecThe other vector
Returns
A new 3x1 vector this+vec
KudanVector3 multiply ( float  scalar)

Mutliply this vector X by a scalar s = Xs

Parameters
scalarThe value with which to multiply the elements of this vector
Returns
A new vector representing the vector multiplied by the scalar
float norm ( )

Return the L2 (Euclidean) norm of this vector

Returns
A float representing the vector's length
KudanVector3 operator* ( float  scalar)

Overloaded multiplication operator - calls the multiply function

Parameters
scalarThe value with which to multiply the elements of this vector
Returns
A new vector representing the vector multiplied by the scalar
KudanVector3 operator+ ( KudanVector3  vec)

Overloaded addition operator - calls the add function

Parameters
vecThe vector to add to this
Returns
The result of this+vec
KudanVector3 operator- ( KudanVector3  vec)

Overloaded subtaction operator - calls the subtract function

Parameters
vecThe vector to subtract from this
Returns
The result of this-vec
KudanVector3 subtract ( KudanVector3  vec)

Subtract another vector from this

Parameters
vecThe vector to subtract from this
Returns
The result of this-vec
std::string toString ( )

Returns a representation of this as a string (x,y,z)

Returns
A string representation of this vector
void zero ( )

Set the all coefficients to zero

Field Documentation

float x

Public x, y, z coefficients of the vector


The documentation for this class was generated from the following file: