GithubHelp home page GithubHelp logo

adamnemecek / algeosharp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mjaun/algeosharp

0.0 3.0 0.0 68 KB

A class library for using conformal geometric algebra in C#

License: GNU General Public License v2.0

C# 100.00%

algeosharp's Introduction

AlgeoSharp

A class library for using conformal geometric algebra in C#

Example Application

A lot of operators are overloaded so that you can write your calculations in C# source code almost like you would do in a math software. But please be aware that I didn't have enough time to fully understand how the theory of geometric algebra really works. I just had an exciting time by implementing all the operators in C# so that it becomes easy to play with those calculations. This means that there is ABSOLUTELY NO WARRANTY that the calculations are correct and you should expect bugs in this library (it is not tested)!

Here are some useful links to get an idea about the theory and the uses of geometric algebra:

This project was originally created on SourceForge in the context of a optional module during my studies. Since I'd like to have my projects in one place I moved this project to GitHub. I also did some tweaks so that the visualization and the example application works on Linux with Mono.

Usage

Currently there is no documentation of the library. Have a look at the sample application to get an idea of how everything works. Additionally I put some illustrative code below which shows some example calculations using geometric algebra with AlgeoSharp.

// Create some points
var p1 = IPNS.CreatePoint(2, 3, 0);
var p2 = IPNS.CreatePoint(-3, -4, 3);
var p3 = IPNS.CreatePoint(1, -5, 0);
var p4 = IPNS.CreatePoint(-1, -2, -3);

// Calculate the sphere described by all four points
var s = (p1 ^ p2 ^ p3 ^ p4).Dual;

// Calculate the plane described by three points
var p = (p1 ^ p2 ^ p3 ^ Basis.E8).Dual;

// Calculate the intersection between the plane and the sphere ...
var i = s ^ p;

// ... this should give us a circle which could also be obtained 
// by using the three points
var c = (p1 ^ p2 ^ p3).Dual;

In order to visualize the results there is a helper library AlgeoSharp.Visualization. This library uses OpenTK to display the MultiVectors in a window (see sample application), so make sure you have OpenTK installed on your system.

See http://www.opentk.com/

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.