simplevectors  0.3.9
Simple vector implementations in C++
Public Member Functions | Public Attributes | List of all members
svector::Vec3D Struct Reference

A minimal 3D vector representation. More...

#include <embed.hpp>

Public Member Functions

 Vec3D ()
 No-argument constructor. More...
 
 Vec3D (const double xOther, const double yOther, const double zOther)
 Initializes a vector given xyz components. More...
 
 Vec3D (const Vec3D &other)=default
 Copy constructor.
 
 Vec3D (Vec3D &&) noexcept=default
 Move constructor. More...
 
Vec3Doperator= (const Vec3D &other)
 Assignment operator.
 
Vec3Doperator= (Vec3D &&) noexcept=default
 Move assignment operator. More...
 
virtual ~Vec3D ()=default
 Destructor. More...
 
Vec3Doperator+= (const Vec3D &other)
 In-place addtion. More...
 
Vec3Doperator-= (const Vec3D &other)
 In-place subtraction. More...
 
Vec3Doperator*= (const double &other)
 In-place scalar multiplication. More...
 
Vec3Doperator/= (const double &other)
 In-place scalar division. More...
 

Public Attributes

double x
 The x-component of the 3D vector.
 
double y
 The y-component of the 3D vector.
 
double z
 The z-component of the 3D vector.
 

Detailed Description

A minimal 3D vector representation.

Constructor & Destructor Documentation

◆ Vec3D() [1/3]

svector::Vec3D::Vec3D ( )
inline

No-argument constructor.

Initializes a zero vector.

◆ Vec3D() [2/3]

svector::Vec3D::Vec3D ( const double  xOther,
const double  yOther,
const double  zOther 
)
inline

Initializes a vector given xyz components.

Parameters
xOtherThe x-component.
yOtherThe y-component.
zOtherThe z-component.

◆ Vec3D() [3/3]

svector::Vec3D::Vec3D ( Vec3D &&  )
defaultnoexcept

Move constructor.

Uses C++ default move constructor.

◆ ~Vec3D()

virtual svector::Vec3D::~Vec3D ( )
virtualdefault

Destructor.

Uses C++ default destructor.

Member Function Documentation

◆ operator*=()

Vec3D& svector::Vec3D::operator*= ( const double &  other)
inline

In-place scalar multiplication.

Performs scalar multiplication on the current object.

Parameters
otherThe number to multiply by.

◆ operator+=()

Vec3D& svector::Vec3D::operator+= ( const Vec3D other)
inline

In-place addtion.

Adds another vector object to current vector.

Parameters
otherThe other object to add.

◆ operator-=()

Vec3D& svector::Vec3D::operator-= ( const Vec3D other)
inline

In-place subtraction.

Subtracts another vector object from current vector.

Parameters
otherThe other object to subtract.

◆ operator/=()

Vec3D& svector::Vec3D::operator/= ( const double &  other)
inline

In-place scalar division.

Performs scalar division on the current object.

Parameters
otherThe number to divide by.

◆ operator=()

Vec3D& svector::Vec3D::operator= ( Vec3D &&  )
defaultnoexcept

Move assignment operator.

Uses C++ default move assignment operator.


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