Code Monkey home page Code Monkey logo

kiss_clang_3d_utils's Introduction

kiss_clang_3d_utils

A keep it stupid (but not too stupid either...), simple, library, in c-language, providing 3d utils such as vectors, quaternions, and related primitives.

This library was written since I needed to perform some simple 3d operations such as rotations, changes of referentials, etc, in some Arduino code. I could not find a simple, unit-tested, easy-to-use, fast, low level library to use quaternions and I decided to write mine.

The choice of using c instead of cpp is for having the wides compatibility possible, and also to simplify the overall library design. Note that the core of the library, i.e the src/kiss_clang_3d.h/c, are compatible with pure C, but that extra components are C++ only for simplicity of implementation. In particular, the src extra utils are C++ only, and the test suite is also based on the C++ catch2 unit test framework.

The aim is to keep the code as simple and short as possible, but not too simple either. For example, calculating the rotation of a vector by a quaternion is implemented using the Rodriguez method, which is much more computationally efficient than a naive double quaternion product.

Library installation

The whole library is provided as a couple of clang files, i.e. src/kiss_clang_3d_utils.h/c. Copy these and / or make them accessible to your project, and you are ready to go. The only thing you should need to do is to set the fundamental type you want to use in the #define F_TYPE definition at the start of the header. Both float and double should work nicely. Both are unit tested.

License

Made available under the MIT license: no guarantees whatsoever, but do whatever you want with the content of this repository.

Tests

Tests are in the tests folder. For simplicity, the tests are run using Catch2, a cpp-lang framework for unit testing. To run all tests, just run the tests/script_compile_run_tests.sh. That will run all tests twice actually, once with fundamental type float, and once with fundamental type double. Unit testing happens with quite aggressive flags, for example, unintended type conversions should be treated as an error.

kiss_clang_3d_utils's People

Contributors

jerabaul29 avatar

Stargazers

 avatar

Watchers

 avatar

kiss_clang_3d_utils's Issues

add CI

add a CI action to make sure test commits coming in.

Add 2d utils

  • add 2d utils
  • change the name of the repo to kiss_clang_2d_3d_utils

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.