项目作者: KanchiShimono

项目描述 :
Solver for Cubic and Quadratic equations written in julia
高级语言: Julia
项目地址: git://github.com/KanchiShimono/CubicEquation.jl.git
创建时间: 2016-11-18T16:50:15Z
项目社区:https://github.com/KanchiShimono/CubicEquation.jl

开源协议:MIT License

下载


Cubic equation solver

Cubic equations is solver for Cubic and Quadratic equations. This module is writen
in Julia.

Requirements

  • Julia 0.5

Installation

Clone this repository in Julia repl.

  1. Pkg.clone("https://github.com/KanchiShimono/CubicEquation.jl")

Usage

Example solving Cubic and Quadratic equations.

  1. using CubicEquation
  2. # create Solver object
  3. solver = Solver()
  4. # For Cubic equation
  5. # a*x³ + b*x² + c*x + d = 0
  6. a = 1
  7. b = -2
  8. c = -3
  9. d = 4
  10. # Solve equation
  11. s1, s2, s3 = solver(a, b, c, d)
  12. # s1 = -1.56155, s2 = 1.0, s3 = 2.56155
  13. # For Quadratic equation
  14. # a*x² + b*x + c = 0
  15. a = 1.0
  16. b = -4.0
  17. c = 3.0
  18. # Solve equation
  19. s1, s2 = solver(a, b, c)
  20. # s1 = 1.0, s2 = 3.0