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

Go to the source code of this file.

Data Structures

struct  bn_poly
 

Macros

#define BN_MAX_POLY_DEGREE   6
 
#define BN_CK_POLY(_p)   BU_CKMAG(_p, BN_POLY_MAGIC, "struct bn_poly")
 
#define BN_POLY_NULL   ((struct bn_poly *)NULL)
 
#define BN_POLY_INIT_ZERO   { BN_POLY_MAGIC, 0, {0.0} }
 

Typedefs

typedef struct bn_poly bn_poly_t
 

Functions

struct bn_polybn_poly_mul (struct bn_poly *product, const struct bn_poly *m1, const struct bn_poly *m2)
 multiply two polynomials More...
 
struct bn_polybn_poly_scale (struct bn_poly *eqn, double factor)
 scale a polynomial More...
 
struct bn_polybn_poly_add (struct bn_poly *sum, const struct bn_poly *poly1, const struct bn_poly *poly2)
 add two polynomials More...
 
struct bn_polybn_poly_sub (struct bn_poly *diff, const struct bn_poly *poly1, const struct bn_poly *poly2)
 subtract two polynomials More...
 
void bn_poly_synthetic_division (struct bn_poly *quo, struct bn_poly *rem, const struct bn_poly *dvdend, const struct bn_poly *dvsor)
 Divides any polynomial into any other polynomial using synthetic division. Both polynomials must have real coefficients. More...
 
int bn_poly_quadratic_roots (struct bn_complex roots[], const struct bn_poly *quadrat)
 Uses the quadratic formula to find the roots (in ‘complex’ form) of any quadratic equation with real coefficients. More...
 
int bn_poly_cubic_roots (struct bn_complex roots[], const struct bn_poly *eqn)
 Uses the cubic formula to find the roots (in ‘complex’ form) of any cubic equation with real coefficients. More...
 
int bn_poly_quartic_roots (struct bn_complex roots[], const struct bn_poly *eqn)
 Uses the quartic formula to find the roots (in ‘complex’ form) of any quartic equation with real coefficients. More...
 
int bn_poly_findroot (bn_poly_t *eqn, bn_complex_t *nxZ, const char *str)
 
void bn_poly_eval_w_2derivatives (bn_complex_t *cZ, bn_poly_t *eqn, bn_complex_t *b, bn_complex_t *c, bn_complex_t *d)
 
int bn_poly_checkroots (bn_poly_t *eqn, bn_complex_t *roots, int nroots)
 
void bn_poly_deflate (bn_poly_t *oldP, bn_complex_t *root)
 
int bn_poly_roots (bn_poly_t *eqn, bn_complex_t roots[], const char *name)
 
void bn_pr_poly (const char *title, const struct bn_poly *eqn)
 
void bn_pr_roots (const char *title, const struct bn_complex roots[], int n)