GithubHelp home page GithubHelp logo

rm-dr / daisy Goto Github PK

View Code? Open in Web Editor NEW
7.0 1.0 1.0 1.4 MB

A pretty TUI scientific calculator.

Home Page: https://daisy.betalupi.com

License: GNU General Public License v3.0

Rust 96.44% Shell 0.43% Nix 0.57% Dockerfile 0.19% HTML 2.15% Makefile 0.21%
calculator parser physics quantities rust science scientific-calculator scientific-computing terminal terminal-based units mathematical-expressions mathematics web-app webapp

daisy's Introduction

A pretty, general-purpose scientific calculator with support for units, derivatives, and more.

Many features are missing, this is still under development.

Web demo: here (won't work on mobile)

๐Ÿ“ฆ Installation

  • From source: cargo build --release, binary will be at ./target/release/daisy
  • Cargo: cargo install daisycalc
  • Arch: yay -S daisy
  • Debian: coming soon
  • Nix: Use default.nix. Daisy isn't in nixpkgs yet, you'll need to add something like the following to configuration.nix:
let
  daisy = builtins.fetchGit {
    url = "https://github.com/rm-dr/daisy.git";
    ref = "master";
  } + /default.nix;
in
{
  environment.systemPackages = with pkgs; [
    (callPackage daisy { })
  ];
}

๐Ÿ“น Screenshot

Screenshot

๐Ÿ› ๏ธ Features

  • Open-source
  • Carefully designed and easy-to-read prompt
  • Supports many physical units, with metric and binary prefixes
  • Supports exponential notation
  • Clear syntax, parsed input is always re-printed as a sanity check.
  • Useful, detailed error messages

๐Ÿ“‘ Usage

All documentation is built into the prompt. Use the help command to view it.

Evaluate expressions:

  • Basic math: 103 / 2 * 43
  • Functions: sqrt(1.4^3 + 4) * sin(pi / 4)
  • Scientific notation: 1.2e12 * 1e-5

Physical units

  • Unit operations: 2 day + 1 hour
  • Unit conversion: 2 day + 1 hour to minutes
  • Compound units: 10 m/s to mph
  • Conversion errors: 1 liter to volt

Varables

  • Previous answer: ans + 2
  • Variable assignment: a = 143

๐ŸŒน Additional Notes

Unit Conversion

The conversion operator to converts its left argument to the unit of its right argument, ignoring its value. For example, 5m to mi and 5m to 10mi are identical.

Celsius and Fahrenheit

Celsius and Fahrenheit are not supported as first-class units because they require an offset when converting from other temperature units. This leads to ambiguity when adding units, since one temperature must be seen as a difference rather than an absolute temperature.

Daisy instead provides four functions (fromCelsius, toCelsius, fromFahrenheit, toFahrenheit) which convert between scalars and Kelvin.

  • "from" functions take a scalar and return a value in Kelvin: fromCelsius(0) = 273.15K
  • "to" functions take a value in Kelvin and return a scalar: toCelsius(273.15 K) = 0

Functions FtoC and CtoF are also provided:

  • FtoC(x) = toCelsius(fromFahrenheit(x))
  • CtoF(x) = toFahrenheit(fromCelsius(x))

Multiplication Order

Implicit multiplication has a higher priority than division. pi/2 radians will parse as pi/(2 radians). Type (pi/2) radians or pi/2 * radians to get 90 degrees.

daisy's People

Contributors

rm-dr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

bojohnson5

daisy's Issues

`ans` not defined

I have v1.0.1 installed on MacOS 12.6.9 from cargo. I'm running daisy in iTerm2 and not having the ability to use ans and the last answer.
Screen Shot 2023-09-20 at 12 02 39 PM

first key typed isn't read

Great project! Super useful for quick calculations using units! Same setup as before, MacOS Monterey with iTerm2. When first starting daisy and typing, the first character I type isn't read. See the image as an example. I was typing help. Things will work after this first key isn't read.
Screen Shot 2023-09-20 at 2 45 27 PM

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.