Code Monkey home page Code Monkey logo

cunits's Introduction

cunits A Dimensional Analysis and Conversion Library for C++

This is a project aimed at making unit conversions and dimensional analysis quicker and more readable. In reality, this project was made in a personal attempt to learn more about the c++ language. For a more comprehensive library, I recommend mp-units. But who knows? Maybe this will be useful to someone as a lightweight alternative.

All units are implicitly converted to their base value, where then different definitions can be called.

Files:

  • units.h Base unit definition file.
  • basic.h Includes very basic units like the meter, mole, kilogram, candela, etc.
  • si.h Includes all SI units and definitions.
  • time.h Includes basic tim
  • astro.h Includes standard static astronomical units. Measurements with uncertainty like galactic year and lunar distance are not yet included.

Planned Files:

  • imperial.h Includes all basic imperial units like foot, yard, etc.
  • sci.h Includes scientific values like the charge of the electron, planck length, the gravitational constant, etc.

cunits's People

Contributors

1ydia avatar

Watchers

 avatar

cunits's Issues

Adding Common Units

Some common units aren’t currently included.

imperial.h

  • Inch
  • Foot
  • Yard
  • Mile
  • Etc (Add more here)

Adding more in the future.

Generalizing SI Units

Currently, si.h has separate definitions for every single unit multiple, like mg, g, Mg, pg, etc.

It’s important that units still be easily accessible. Maybe something like
Unit u = milli * gram?

  • Generalize SI Units

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.