GithubHelp home page GithubHelp logo

danston / blwp Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 17 KB

A convex combination of Wachspress and any other 2D closed-form barycentric coordinates.

License: MIT License

CMake 2.07% C++ 97.93%

blwp's Introduction

A convex combination of Wachspress and any other 2D closed-form barycentric coordinates Ver. 1.0.0

Description

This set of C++ classes provides you with an implementation of a convex combination of Wachspress and any other 2D closed-form barycentric coordinates as discussed in Chapter 4 of the dissertation: D. Anisimov. Analysis and new constructions of generalized barycentric coordinates in 2D. To appear, 2017. The implementation is based on the corresponding pseudocode from Appendix A of this dissertation.

NOTE: This code has been tested only on Mac OS!

Run the code

In order to run the code, do the following:

  1. Install macports
  2. Open terminal and type the following:
  sudo port install cmake
  cd path_to_the_folder/blwp/2d/
  mkdir bin
  cd bin
  cmake -DCMAKE_BUILD_TYPE=Debug ..
  make
  ./blwp

For the release version use instead:

cmake -DCMAKE_BUILD_TYPE=Release ..

Example

// Polygon.
std::vector<VertexR2> poly(8);

poly[0] = VertexR2(0.0 , 0.0 );
poly[1] = VertexR2(0.34, 0.32);
poly[2] = VertexR2(0.68, 0.08);
poly[3] = VertexR2(1.12, 0.31);
poly[4] = VertexR2(1.12, 1.11);
poly[5] = VertexR2(0.49, 1.07);
poly[6] = VertexR2(0.72, 0.49);
poly[7] = VertexR2(0.14, 0.58);

// Evaluation point.
VertexR2 query(0.56, 0.555);

// Storage for the computed coordinates.
std::vector<double> b;

// Compute coordinates.
BlendedWachspressR2<MeanValueR2> wmc(poly);
wmc.compute(query, b);

// Output the resulting coordinates.
std::cout << "\nResult: ";
for (size_t i = 0; i < b.size(); ++i) std::cout << b[i] << " ";
std::cout << "\n\n";
NOTE: For the complete example see main.cpp!

Bugs

If you find any bugs, please report them to me, and I will try to fix them as soon as possible!

blwp's People

Contributors

danston 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.