Git Product home page Git Product logo

basins's Introduction

Basins

Plots basins of attractions for the roots of a cubic polynomial in complex plane using newton's method


newton.m is a function that can be used in the following ways

newton(f, df, x0, tol)

f - a function defined by the user df - the derivative of the function f x0 - the starting point for the root finding method tol - the tolerance (difference between consecutive terms)


cfnewt.m is a function that can be used in the following way

cfnewt(a, b, c, d, x1, y1, x2, y2, n)

a, b, c, d - coefficients of polynomial ax^3 + bx^2 + cx + d x1, y1 - bottom left coordinate on plot x2, y2 - top right coordinate on plot n - number of columns of pixels (total number of pixels is n^2


Example running cfnewt

>> cfnewt(1, 0, 0, 1, -5, -5, 5, 5, 500)

Starting rendering process... Working on pixel column 100 out of 500 Working on pixel column 200 out of 500 Working on pixel column 300 out of 500 Working on pixel column 400 out of 500 Working on pixel column 500 out of 500

Plotting...

Roots

Red: -1.000000+0.000000i

Green: 0.500000+0.866025i

Blue: 0.500000-0.866025i

The number of uncolored pixels is 0

Elapsed time is 14.815667 seconds.


Plot of Basins

basins's People

Contributors

sss-ng avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

l5d1l5

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.