44#define BN_MAX_POLY_DEGREE 6
56#define BN_CK_POLY(_p) BU_CKMAG(_p, BN_POLY_MAGIC, "struct bn_poly")
57#define BN_POLY_NULL ((struct bn_poly *)NULL)
58#define BN_POLY_INIT_ZERO { BN_POLY_MAGIC, 0, {0.0} }
117 const struct bn_poly *quadrat);
Header file for the BRL-CAD common definitions.
int bn_poly_checkroots(bn_poly_t *eqn, bn_complex_t *roots, int nroots)
int bn_poly_findroot(bn_poly_t *eqn, bn_complex_t *nxZ, const char *str)
struct bn_poly * bn_poly_add(struct bn_poly *sum, const struct bn_poly *poly1, const struct bn_poly *poly2)
add two polynomials
#define BN_MAX_POLY_DEGREE
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 ...
void bn_pr_poly(const char *title, const struct bn_poly *eqn)
void bn_poly_deflate(bn_poly_t *oldP, bn_complex_t *root)
void bn_pr_roots(const char *title, const struct bn_complex roots[], int n)
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...
int bn_poly_roots(bn_poly_t *eqn, bn_complex_t roots[], const char *name)
struct bn_poly * bn_poly_scale(struct bn_poly *eqn, double factor)
scale a polynomial
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 coeffici...
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)
struct bn_poly * bn_poly_mul(struct bn_poly *product, const struct bn_poly *m1, const struct bn_poly *m2)
multiply two polynomials
struct bn_poly * bn_poly_sub(struct bn_poly *diff, const struct bn_poly *poly1, const struct bn_poly *poly2)
subtract two polynomials
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 coef...
double fastf_t
fastest 64-bit (or larger) floating point type
Global registry of recognized magic numbers.
fastf_t cf[BN_MAX_POLY_DEGREE+1]
fundamental vector, matrix, quaternion math macros