Giter Club home page Giter Club logo

geometrica's Introduction

Geometrica: A Library for Various Geometry-Related Tasks

on-push-do-docs Build and Run Unit Tests

Primitives

Basic information about the different types of primitives used by the algorithms can be found in Primitives.

Convex Hull

Detailed description in Convex Hull Algorithms.

Convex hull of a set of point can be created using the constructor like this:

var pts = new List<Point2>()
{
    new(0, 0),
    new(1, 0),
    new(0, 1),
    new(0.1, 0.1)
};

var ch = new ConvexHull(pts);

Which uses a divide and conquer algorightm.

Once the convex hull is created, the points on the hull can either be accessed using an indexer or iterated through with IEnumerable.

var pt = ch[0]; //returns (0, 0)
foreach (var point in ch)
{
    //...
}

Delaunay Triangulation

Detailed description in Delaunay Triangulation.

Delaunay triangulation of set of points can be created using the constructor:

var p1 = new Point2(0, 0);
var p2 = new Point2(1, 0);
var p3 = new Point2(0, 1);
var p4 = new Point2(1, 1);

var dt = new DelaunayTriangulation(new Point2[] { p1, p2, p3 });

If you provide an empty set of points, or create the class instance using a parameterless constructor, the resulting Delaunay triangulation will be empty. Points can be added to a pre-existing Delaunay triangulation using a dedicated method. For adding a new point into a triangulation, it does not matter how it was created or if it contains any other points.

dt.Add(new Point2(0.1, 0.1));

Credits

  • Refactoring the code with ReSharper.
  • Some of the algorithms implemented in this library were inspired by the materials published by Prof. Ivana Kolingerova from Universy of West Bohemia, if you are interested in this stuff and speak Czech, go czech them out.

geometrica's People

Contributors

actions-user avatar tvomacka avatar

Stargazers

 avatar

Watchers

 avatar  avatar

geometrica's Issues

Graham Scan sorts already sorted points

For the merge step in Divide and Conquer, the points are already sorted when they are passed to the Graham Scan algorithm.
The functionality of sorting and convex hull construction should be split.

Unit test & ToString localization

Unit tests fail because the ToString returns en-US localization on build server, but cz-CS localization on my development machine.

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.