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 ()
 

Public Attributes

float x
 
float y
 
float z
 

Detailed Description

Simple representation of a 3D point or vector.

Constructor & Destructor Documentation

◆ KudanVector3() [1/2]

KudanVector3::KudanVector3 ( )

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

◆ KudanVector3() [2/2]

KudanVector3::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

◆ add()

KudanVector3 KudanVector3::add ( KudanVector3  vec)

Add this to another 3x1 vector

Parameters
vecThe other vector
Returns
A new 3x1 vector this+vec

◆ multiply()

KudanVector3 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

◆ norm()

float KudanVector3::norm ( )

Return the L2 (Euclidean) norm of this vector

Returns
A float representing the vector's length

◆ operator*()

KudanVector3 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

◆ operator+()

KudanVector3 KudanVector3::operator+ ( KudanVector3  vec)

Overloaded addition operator - calls the add function

Parameters
vecThe vector to add to this
Returns
The result of this+vec

◆ operator-()

KudanVector3 KudanVector3::operator- ( KudanVector3  vec)

Overloaded subtaction operator - calls the subtract function

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

◆ subtract()

KudanVector3 KudanVector3::subtract ( KudanVector3  vec)

Subtract another vector from this

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

◆ toString()

std::string KudanVector3::toString ( )

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

Returns
A string representation of this vector

◆ zero()

void KudanVector3::zero ( )

Set the all coefficients to zero

Member Data Documentation

◆ x

float KudanVector3::x

Public x, y, z coefficients of the vector


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