V3FIT
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
vector3d Class Reference

A vector. More...

#include <vector3d.hpp>

Public Member Functions

 vector3d (const double x_, const double y_, const double z_)
 vector3d constructor. More...
 
const double length () const
 Length of a vector3d instance. More...
 
const vector3d normalize () const
 Normalize vector3d instance. More...
 

Static Public Member Functions

static const vector3d cross_product (const vector3d &v1, const vector3d &v2)
 Takes the cross product of two vectors. More...
 
static const double dot_product (const vector3d &v1, const vector3d &v2)
 Takes the doc product of two vectors. More...
 

Public Attributes

const double x
 x component.
 
const double y
 y component.
 
const double z
 z component.
 

Detailed Description

A vector.

Class representing a vector in cartesian coordinates.

Definition at line 19 of file vector3d.hpp.

Constructor & Destructor Documentation

◆ vector3d()

vector3d::vector3d ( const double  x_,
const double  y_,
const double  z_ 
)

vector3d constructor.

Constructs a vector at a x, y, z position.

Parameters
[in]x_X position.
[in]y_Y position.
[in]z_Z position.

Definition at line 21 of file vector3d.cpp.

Member Function Documentation

◆ cross_product()

const vector3d vector3d::cross_product ( const vector3d v1,
const vector3d v2 
)
static

Takes the cross product of two vectors.

V1 X V2.

Parameters
[in]v1First vector.
[in]v2Second vector.
Returns
Cross product of v1 and v2.

Definition at line 56 of file vector3d.cpp.

◆ dot_product()

const double vector3d::dot_product ( const vector3d v1,
const vector3d v2 
)
static

Takes the doc product of two vectors.

V1 . V2.

Parameters
[in]v1First vector.
[in]v2Second vector.
Returns
Dot product of v1 and v2.

Definition at line 71 of file vector3d.cpp.

◆ length()

const double vector3d::length ( ) const

Length of a vector3d instance.

Length is defined as Sqrt(V.V).

Returns
Length of vector.

Definition at line 32 of file vector3d.cpp.

◆ normalize()

const vector3d vector3d::normalize ( ) const

Normalize vector3d instance.

The normalized vector is defined as V/|V|.

Returns
Normalized vector.

Definition at line 43 of file vector3d.cpp.


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