Skip to content

Sabetsuka (差別化) makes it easy and painless to differentiate polynomials

License

Notifications You must be signed in to change notification settings

johtai/sabetsuka

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sabetsuka

Sabetsuka (差別化) makes it easy and painless to differentiate polynomials.

The repository was inspired by the Nokogiri gem

Installation

Install the gem and add to the application's Gemfile by executing:

$ gem build sabetsuka.gemspec
$ gem install sabetsuka

or

$ bundle add sabetsuka

Usage

The term format: 3x^5, 5y, 7

The polynomial format: 3x + 5y + 6, 5x - 2, -3y^2 - 5

polynomial = Sabetsuka::Polynomial.new("3x^3 + 4x^2 + 5x + 4", "x")
derivative = polynomial.differentiate

puts "Polynomial: #{polynomial.to_s}"
puts "Derivative: #{derivative.to_s}"

# Output:
# Polynomial: 3x^3 + 4x^2 + 5x + 4
# Derivative: 9x^2 + 8x + 5

About

Sabetsuka (差別化) makes it easy and painless to differentiate polynomials

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages