[ANN] rubygem roots-1.0.0

J

jzakiya

This is an announcement of the release of rubygems 'roots-1.0.0'.

The 'roots' gem provides two methods 'root' and 'roots' which will
compute all n roots of a real or complex number.

The paper describing the math/operation of the gem can be read/downloaded here:

http://www.scribd.com/doc/60067570/Roots-in-Ruby

The use syntax for 'root' and 'roots' is shown below.
------------------------------------------------------
Use syntax: val.root(n,{k})
root(n,k=0) n is root 1/n exponent, integer > 0
k is nth ccw root 1..n , integer >=0
If k not given default root returned, which are:
for +val => real root |val**(1.0/n)|
for -val => real root -|val**(1.0/n)| when n is odd
for -val => first ccw complex root when n is even

9.root(2); -32.root(5,3); (-100.43).root 6,6

Use syntax: val.roots(n,{opt})
roots(n,opt=0) n is root 1/n exponent, integer > 0
opt, optional string input, are:
0 : default (no input), return array of n ccw roots
'c'|'C': complex, return array of complex roots
'e'|'E': even, return array even numbered roots
'o'|'O': odd , return array odd numbered roots
'i'|'I': imag, return array of imaginary roots
'r'|'R': real, return array of real roots
An empty array is returned for an opt with no members.

9348134943.roots(9); -89.roots(4,'real'); 2.2.roots 3,'Im'

Can ask: How many real roots of x: x.roots(n,'real').size
What's the 3rd 5th root of (4+9i): Complex(4,9).root(5,3)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Roots Module 10
Roots Module (code) 0
Root Module (code) 0
Correcting complex math 10
Issue with textbox script? 0
[ANN] tagz-1.0.0 0
ANN main-4.4.0 0
[ANN] Text::Format 1.0.0 5

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top