HephAudio v3.0.6
A cross-platform C++ library for recording, playing, and processing audio on Windows, Android, Linux, iOS, and macOS.
Loading...
Searching...
No Matches
Heph::Complex Struct Reference

struct for representing complex numbers. More...

#include <Complex.h>

Public Member Functions

constexpr Complex ()
 
constexpr Complex (double real, double imag)
 
constexpr Complex operator- () const
 
constexpr Complex operator+ (double rhs) const
 
constexpr Complex operator+ (const Complex &rhs) const
 
constexpr Complexoperator+= (double rhs)
 
constexpr Complexoperator+= (const Complex &rhs)
 
constexpr Complex operator- (double rhs) const
 
constexpr Complex operator- (const Complex &rhs) const
 
constexpr Complexoperator-= (double rhs)
 
constexpr Complexoperator-= (const Complex &rhs)
 
constexpr Complex operator* (double rhs) const
 
constexpr Complex operator* (const Complex &rhs) const
 
constexpr Complexoperator*= (double rhs)
 
constexpr Complexoperator*= (const Complex &rhs)
 
constexpr Complex operator/ (double rhs) const
 
constexpr Complex operator/ (const Complex &rhs) const
 
constexpr Complexoperator/= (double rhs)
 
constexpr Complexoperator/= (const Complex &rhs)
 
constexpr bool operator== (const Complex &rhs) const
 
constexpr bool operator!= (const Complex &rhs) const
 
constexpr Complex Conjugate () const
 
constexpr double MagnitudeSquared () const
 
double Magnitude () const
 
double Phase () const
 

Public Attributes

double real
 
double imag
 

Detailed Description

struct for representing complex numbers.

Constructor & Destructor Documentation

◆ Complex() [1/2]

Heph::Complex::Complex ( )
inlineconstexpr

creates a new instance and initializes it with default values.

◆ Complex() [2/2]

Heph::Complex::Complex ( double real,
double imag )
inlineconstexpr

creates a new instance and initializes it with the provided values.

Parameters
realreal component of the complex number.
imagimaginary component of the complex number.

Member Function Documentation

◆ Conjugate()

Complex Heph::Complex::Conjugate ( ) const
inlineconstexpr

calculates the complex conjugate of the current instance and returns it as a new instance.

◆ MagnitudeSquared()

double Heph::Complex::MagnitudeSquared ( ) const
inlineconstexpr

calculates the squared magnitude of the current instance.

◆ Magnitude()

double Heph::Complex::Magnitude ( ) const

calculates the magnitude of the current instance.

◆ Phase()

double Heph::Complex::Phase ( ) const

calculates the phase of the current instance.

Member Data Documentation

◆ real

double Heph::Complex::real

real component of the complex number.

◆ imag

double Heph::Complex::imag

imaginary component of the complex number.