asimone0 / quadratic

A Go language library for solving quadratic equations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A golang library for solving quadratic equations

Usage:

import "github.com/tonestuff/quadratic"

xpos, xneg := quadratic.Solve(a,b,c)

a,b,c correspond to the coefficients of the quadratic to be solved.

Solve() returns 2 complex128 values that represent the positive and negative roots of the equation.

Use real(ComplexType) and imag(ComplexType) to access the real and imaginary components of the roots

About

A Go language library for solving quadratic equations


Languages

Language:Go 100.0%