Skip to content

yashsriram/polynomial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

polynomial

description

  • A simple implementation of a polynomial.
  • Rust port of my first ever coding project. (Was written in C++. Boy what a mess that was!)

roadmap

  • For arbitrary polynomials.
    • "no zero-coeff terms in memory" invariant.
    • latex compatible print.
    • +, -, *, /, % operators.
    • value at.
    • derivative, integral.
    • finding all real roots.
    • plotting multiple polynomials in a finite range.
    • better root finding (using descartes rule, variable dx ...).

code

  • The code is written in stable rust.
  • gnuplot is used for plotting.

documentation

  • The documentation for the code is itself.
  • There is minimal documentation for some items, use cargo doc --open to view it.

usage

  • The polynomial implementation is provided as a library.
  • The usage is illustrated in examples under examples/ directory.
  • To run an example use cargo run --example <example-name-without-rs-extension>.
  • Get it in your crate using Cargo.toml dependency entry polynomial = { git = "https://github.com/buggedbit/polynomial" }.

demonstration

Arithmetic operations on polynomials are illustrated below.

  • Addition

  • Subtraction

  • Multiplication

  • Division

  • Remainder

Plotting arbitrary number of polynomials in a window.