complex.c File Reference

#include "common.h"
#include <stdio.h>
#include <math.h>
#include "machine.h"
#include "bu.h"
#include "vmath.h"
#include "bn.h"

Include dependency graph for complex.c:

Go to the source code of this file.

Defines

#define SIGN(x)   ((x) == 0 ? 0 : (x) > 0 ? 1 : -1)
#define ABS(a)   ((a) >= 0 ? (a) : -(a))

Functions

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


Detailed Description

Functions:
Author:
Douglas A Gwyn (Original Version)

Michael John Muuss (Macro Version)

Source -
SECAD/VLD Computing Consortium, Bldg 394
The U. S. Army Ballistic Research Laboratory
Aberdeen Proving Ground, Maryland 21005

Definition in file complex.c.


Define Documentation

#define SIGN x   )     ((x) == 0 ? 0 : (x) > 0 ? 1 : -1)
 

Definition at line 56 of file complex.c.

Referenced by bn_cx_sqrt().

#define ABS  )     ((a) >= 0 ? (a) : -(a))
 

Definition at line 57 of file complex.c.

Referenced by bn_cx_div().


Function Documentation

void bn_cx_div register bn_complex_t ap,
register const bn_complex_t bp
 

Divide one complex by another.

B N _ C X _ D I V

bn_cx_div( &a, &b ) divides a by b . Zero divisor fails. a and b may coincide. Result stored in a.

Definition at line 68 of file complex.c.

References ABS, bu_log(), FAST, NEAR_ZERO, and SQRT_SMALL_FASTF.

Here is the call graph for this function:

void bn_cx_sqrt bn_complex_t op,
register const bn_complex_t ip
 

Compute square root of complex number.

B N _ C X _ S Q R T

bn_cx_sqrt( &out, &c ) replaces out by sqrt(c)

Note: This is a double-valued function; the result of bn_cx_sqrt() always has nonnegative imaginary part.

Definition at line 112 of file complex.c.

References bn_cx_ampl, FAST, bn_complex::im, bn_complex::re, and SIGN.


Generated on Mon Sep 18 01:25:02 2006 for BRL-CAD by  doxygen 1.4.6