This project has moved and is read-only. For the latest updates, please go here.

Bisection Roots

Apr 13, 2014 at 6:55 PM
Edited Apr 13, 2014 at 7:26 PM
Hi! I have a polynomial function from which I'd like to calculate the roots. Can anyone show me an example of such in VB.NET? I figured that I have to create a funtion of System.Func(Of Double, Double) type, but I have no clues about the way of doing that. A quick example with be very much appreciated.

Thanks in advance,
Apr 13, 2014 at 8:16 PM
I don't know recent VB very well, but the following seems to work in LinqPad:
Dim f As Func(Of Double, Double) = Function(x) 2*x^2 - 2*x - 2

Bisection.FindRoot(f, 0, 2) ' 1.61803398874989
Bisection.FindRoot(f, -2, 0) ' -0.618033988749895
Marked as answer by cdrnet on 4/14/2014 at 2:46 AM