BRL-CAD
complex.h File Reference
#include "common.h"
#include "bn/defines.h"
Include dependency graph for complex.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  bn_complex
 Complex numbers. More...
 

Macros

#define bn_cx_copy(ap, bp)   {*(ap) = *(bp);}
 
#define bn_cx_neg(cp)   { (cp)->re = -((cp)->re);(cp)->im = -((cp)->im);}
 
#define bn_cx_real(cp)   (cp)->re
 
#define bn_cx_imag(cp)   (cp)->im
 
#define bn_cx_add(ap, bp)   { (ap)->re += (bp)->re; (ap)->im += (bp)->im;}
 
#define bn_cx_ampl(cp)   hypot((cp)->re, (cp)->im)
 
#define bn_cx_amplsq(cp)   ((cp)->re * (cp)->re + (cp)->im * (cp)->im)
 
#define bn_cx_conj(cp)   { (cp)->im = -(cp)->im; }
 
#define bn_cx_cons(cp, r, i)   { (cp)->re = r; (cp)->im = i; }
 
#define bn_cx_phas(cp)   atan2((cp)->im, (cp)->re)
 
#define bn_cx_scal(cp, s)   { (cp)->re *= (s); (cp)->im *= (s); }
 
#define bn_cx_sub(ap, bp)   { (ap)->re -= (bp)->re; (ap)->im -= (bp)->im;}
 
#define bn_cx_mul(ap, bp)
 
#define bn_cx_mul2(ap, bp, cp)
 

Typedefs

typedef struct bn_complex bn_complex_t
 Complex numbers. More...
 

Functions

void bn_cx_div (bn_complex_t *ap, const bn_complex_t *bp)
 Divide one complex by another. More...
 
void bn_cx_sqrt (bn_complex_t *op, const bn_complex_t *ip)
 Compute square root of complex number. More...