Socket
Book a DemoInstallSign in
Socket

mathviz

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mathviz

1.1.0
bundlerRubygems
Version published
Maintainers
1
Created
Source

-- rdoc --

= MathViz

  • http://github.com/JustinLove/mathviz

== DESCRIPTION:

Turn simple equations (a = b * c) into GraphViz dot files showing relationships, values, and units.

== FEATURES/PROBLEMS:

  • Adds one method to Object (by way of Graphable) and several to Numeric (by way Measurable, Unit, and NumericExtensions) If you use units of measure, each unit will appear on Numeric via module Unit.
  • MathViz produces textual .dot files. You will need a viewer which supports dot files directly, or Graphviz to convert them to images yourself.

== SYNOPSIS:

require 'mathviz'

No units are provided by default.

You can also use 1.unit(:m).per.unit(:s) etc.

module MathViz::Units new_units :m, :s, :kg, :lb, :joule end

MathViz.new { # Alternate form: MathViz.new('optional_output_filename', binding_object)

m = 140.lb * 0.45359237.kg.per.lb
c = 299_792_458.m.per.s
# capitalized values are constants in ruby, so we need the underscore
_E = (m * (c * c)) * 1.joule.per.kg.m.m.per.s.s

binding # Don't forget to return the binding

}.dot # Required to produces the actual .dot file

link:examples/E_mc2.png == REQUIREMENTS:

== INSTALL:

  • sudo gem install mathviz

== LICENSE:

Creative Commons Attribution-Share Alike 3.0 Unported Licence http://creativecommons.org/licenses/by-sa/3.0/

FAQs

Package last updated on 05 May 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.