Giter Club home page Giter Club logo

contouring's Introduction

Zeeman Machine potential

Contouring

This is a small C++ library for plotting contours and/or filled contours. These are contours of the Himmelblau function.

Himmelblau function

The Contouring library draws these contours by sampling the function on a coarse grid and then solving for the function on grid lines, returning a path by callback to drawing functions. The path follows a smooth curve by calling a function for bezier splines.

Splines

The principal function in this library takes quite few arguments:

extern "C" void contour(
    double (*f)(double, double), double s,
    double x0, double y0,
    double x1, double y1,
    unsigned n, unsigned m,

    void (*move_to)(double, double),
    void (*line_to)(double, double),
    void (*curve_to)(double, double, double, double, double, double),
    void (*close_path)());

The function f is being sampled in the range [x0,x1]⨯[y0,y1] on a n⨯m grid. To draw the contour four callback functions need to be given: move_to, line_to, curve_to and close_path. These functions shoud work the same as those of the same name in the Cairo drawing library.

Usage

C++

Just copy the relevant sources to your own project.

Guile

Contouring comes with an interface for the Guile programming language. To compile this interface you need guile 2, and guile-cairo.

Python

A Python interface is still in the works.

License

This work is distributed under the Apache license v2.

contouring's People

Contributors

jhidding avatar

Watchers

 avatar

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.