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
Vectorf Class Reference

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

#include <vectors.h>

Public Member Functions

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

Public Attributes

size_t len
 
float * 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

◆ Vectorf()

Vectorf::Vectorf ( 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

◆ ~Vectorf()

Vectorf::~Vectorf ( )
inline

Member Function Documentation

◆ GetNorm()

float Vectorf::GetNorm ( )
inline

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

Returns
Norm of the vector

Member Data Documentation

◆ len

size_t Vectorf::len

◆ vec

float* Vectorf::vec

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