Hummingbird Flight Software
Flight software for the Hummingbird FCU quadcopter flight controller. Designed to run on the Teensy 4.1. Developed with VSCode+PlatformIO.
Public Member Functions | Public Attributes | List of all members
Vectord Class Reference

A vector object is definied by it's rows/length. More...

#include <vectors.h>

Public Member Functions

 Vectord (size_t len=3)
 Define a vector by it's rows/length. More...
 
double GetNorm ()
 Return the 2-norm (magnitude) of the vector. More...
 
 ~Vectord ()
 

Public Attributes

size_t len
 
double * vec
 

Detailed Description

A vector object is definied by it's rows/length.

When a vector object is created, the array is allocated on the heap (RAM2 for Teensy 4.1) with the C++ 'new' keyword. See the following resource to learn more: https://www.techiedelight.com/dynamic-memory-allocation-in-c-for-2d-3d-array/

Parameters
lenLength of the vector, # of elements. Default = 3

Constructor & Destructor Documentation

◆ Vectord()

Vectord::Vectord ( size_t  len = 3)
inline

Define a vector by it's rows/length.

The vector is allocated on the heap with the C++ 'new' keyword (RAM2 on the Teensy 4.1).

Parameters
lenLength of the vector, # of elements. Default = 3

◆ ~Vectord()

Vectord::~Vectord ( )
inline

Member Function Documentation

◆ GetNorm()

double Vectord::GetNorm ( )
inline

Return the 2-norm (magnitude) of the vector.

Returns
Norm of the vector

Member Data Documentation

◆ len

size_t Vectord::len

◆ vec

double* Vectord::vec

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