Collaboration diagram for Polynomials:
![]() |
Files | |
file | poly.c |
Data Structures | |
struct | bn_poly |
Defines | |
#define | BN_MAX_POLY_DEGREE 4 |
#define | BN_POLY_MAGIC 0x506f4c79 |
#define | BN_CK_POLY(_p) BU_CKMAG(_p, BN_POLY_MAGIC, "struct bn_poly") |
#define | BN_POLY_NULL ((struct bn_poly *)NULL) |
#define | Abs(a) ((a) >= 0 ? (a) : -(a)) |
#define | Max(a, b) ((a) > (b) ? (a) : (b)) |
#define | M_PI 3.14159265358979323846 |
#define | PI_DIV_3 (M_PI/3.0) |
#define | SQRT3 1.732050808 |
#define | THIRD 0.333333333333333333333333333 |
#define | INV_TWENTYSEVEN 0.037037037037037037037037037 |
#define | CUBEROOT(a) (( (a) >= 0.0 ) ? pow( a, THIRD ) : -pow( -(a), THIRD )) |
Typedefs | |
typedef bn_poly | bn_poly_t |
Functions | |
bn_poly * | bn_poly_mul (struct bn_poly *product, const struct bn_poly *m1, const struct bn_poly *m2) |
bn_poly * | bn_poly_scale (struct bn_poly *eqn, double factor) |
bn_poly * | bn_poly_add (struct bn_poly *sum, const struct bn_poly *poly1, const struct bn_poly *poly2) |
bn_poly * | bn_poly_sub (struct bn_poly *diff, const struct bn_poly *poly1, const struct bn_poly *poly2) |
void | bn_poly_synthetic_division (struct bn_poly *quo, struct bn_poly *rem, const struct bn_poly *dvdend, const struct bn_poly *dvsor) |
int | bn_poly_quadratic_roots (struct bn_complex roots[], const struct bn_poly *quadrat) |
int | bn_poly_cubic_roots (struct bn_complex roots[], const struct bn_poly *eqn) |
int | bn_poly_quartic_roots (struct bn_complex roots[], const struct bn_poly *eqn) |
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) |
bn_poly * | bn_poly_mul (register struct bn_poly *product, register const struct bn_poly *m1, register const struct bn_poly *m2) |
multiply two polynomials | |
bn_poly * | bn_poly_scale (register struct bn_poly *eqn, double factor) |
scale a polynomial | |
bn_poly * | bn_poly_add (register struct bn_poly *sum, register const struct bn_poly *poly1, register const struct bn_poly *poly2) |
add two polynomials | |
bn_poly * | bn_poly_sub (register struct bn_poly *diff, register const struct bn_poly *poly1, register const struct bn_poly *poly2) |
subtract two polynomials | |
void | bn_poly_synthetic_division (register struct bn_poly *quo, register struct bn_poly *rem, register const struct bn_poly *dvdend, register const struct bn_poly *dvsor) |
Divides any polynomial into any other polynomial using synthetic division. Both polynomials must have real coefficients. | |
int | bn_poly_quadratic_roots (register struct bn_complex *roots, register const struct bn_poly *quadrat) |
Uses the quadratic formula to find the roots (in `complex' form) of any quadratic equation with real coefficients. | |
HIDDEN void | bn_catch_FPE (int sig) |
int | bn_poly_cubic_roots (register struct bn_complex *roots, register const struct bn_poly *eqn) |
int | bn_poly_quartic_roots (register struct bn_complex *roots, register const struct bn_poly *eqn) |
Uses the quartic formula to find the roots ( in `complex' form ) of any quartic equation with real coefficients. | |
void | bn_pr_poly (const char *title, register const struct bn_poly *eqn) |
void | bn_pr_roots (const char *title, const struct bn_complex *roots, int n) |
|
Definition at line 895 of file bn.h. Referenced by bn_poly_mul(). |
|
Definition at line 904 of file bn.h. Referenced by bu_identify_magic(). |
|
|
|
Definition at line 906 of file bn.h. Referenced by bn_poly_mul(). |
|
Definition at line 53 of file poly.c. Referenced by bn_poly_add(), bn_poly_cubic_roots(), bn_poly_quartic_roots(), and bn_poly_sub(). |
|
|
|
|
|
Definition at line 59 of file poly.c. Referenced by bn_poly_cubic_roots(). |
|
Definition at line 275 of file poly.c. Referenced by bn_poly_cubic_roots(). |
|
Definition at line 276 of file poly.c. Referenced by bn_poly_cubic_roots(). |
|
Definition at line 277 of file poly.c. Referenced by bn_poly_cubic_roots(). |
|
Definition at line 278 of file poly.c. Referenced by bn_poly_cubic_roots(). |
|
Polynomial data type |
|
|
|
|
|
|
|
|
|
|
|
Referenced by bn_poly_quartic_roots(). |
|
Referenced by bn_poly_quartic_roots(). |
|
|
|
|
|
Referenced by bend_pipe_shot(), rt_eto_shot(), rt_superell_shot(), and rt_tor_shot(). |
|
multiply two polynomials bn_poly_mul Definition at line 69 of file poly.c. References BN_MAX_POLY_DEGREE, BN_POLY_NULL, and bn_poly::dgr. |
|
scale a polynomial bn_poly_scale Definition at line 123 of file poly.c. References bn_poly::cf. |
|
add two polynomials bn_poly_add Definition at line 140 of file poly.c. References Abs, bn_poly::cf, and LOCAL. |
|
subtract two polynomials bn_poly_sub Definition at line 174 of file poly.c. References Abs, bn_poly::cf, and LOCAL. |
|
Divides any polynomial into any other polynomial using synthetic division. Both polynomials must have real coefficients. s y n D i v ( ) Definition at line 210 of file poly.c. References bn_poly::dgr. |
|
Uses the quadratic formula to find the roots (in `complex' form) of any quadratic equation with real coefficients. q u a d r a t i c ( ) Definition at line 242 of file poly.c. References bu_log(), LOCAL, NEAR_ZERO, and SQRT_SMALL_FASTF. Here is the call graph for this function: ![]() |
|
Definition at line 311 of file poly.c. References bu_bomb(), bu_is_parallel(), and void(). Referenced by bn_poly_cubic_roots(). Here is the call graph for this function: ![]() |
|
Definition at line 324 of file poly.c. References A, Abs, bn_catch_FPE(), bu_is_parallel(), bu_log(), CUBEROOT, FAST, INV_TWENTYSEVEN, LOCAL, PI_DIV_3, SQRT3, SQRT_MAX_FASTF, THIRD, and void(). Here is the call graph for this function: ![]() |
|
Uses the quartic formula to find the roots ( in `complex' form ) of any quartic equation with real coefficients. B N _ P O L Y _ Q U A R T I C _ R O O T S
Definition at line 431 of file poly.c. References Abs, bn_poly_cubic_roots(), bn_poly_quadratic_roots(), bn_poly::cf, bn_poly::dgr, LOCAL, and Max3. Here is the call graph for this function: ![]() |
|
B N _ P R _ P O L Y Definition at line 509 of file poly.c. References bu_vls_extend(), bu_vls_init(), and bu_vls_strcat(). Here is the call graph for this function: ![]() |
|
Definition at line 552 of file poly.c. References bu_log(). Here is the call graph for this function: ![]() |