[ANN] math-const 1.0.0

I just added a Math/const module to RAA. It provides mathematical and
physical constants both in the MKS and CGS system. See:

http://www.math.umd.edu/~dcarrera/ruby/math/

I’m excited because this is my first module. I think I did a good job in
the install and documentation.

···


Daniel Carrera
Graduate Teaching Assistant. Math Dept.
University of Maryland. (301) 405-5137

Congratulations on a first!

I’m not much of a scientist, but I’m interested
in that stuff and believe in promoting it.

Wouldn’t it be cool if Ruby became known as the
language that scientists use, just as Fortran
became associated with engineering and COBOL
with business? Probably won’t happen, but I
can dream.

The docs look good. Only disappointment is that
you didn’t include the speed of light in
furlongs per fortnight. :wink:

I had thought of a similar module storing all
the information in the periodic table. But it
falls in the category (I think) of things that
are more fun to do than they are useful. So it
hasn’t been high on my to-do list.

Cheers,
Hal

···

----- Original Message -----
From: “Daniel Carrera” dcarrera@math.umd.edu
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Saturday, February 08, 2003 4:51 PM
Subject: [ANN] math-const 1.0.0

I just added a Math/const module to RAA. It provides mathematical and
physical constants both in the MKS and CGS system. See:

http://www.math.umd.edu/~dcarrera/ruby/math/

I’m excited because this is my first module. I think I did a good job in
the install and documentation.

I like this. Wouldn’t it be nice to be able to write
SPEED_OF_LIGHT.unit
→ m / s
(I think this should be easy by subclassing Float).

I also would like to do calculations on units, so that I can write:
s=FwU.new(100,Unit.m) # shold be shorter, perhaps: s=FwU(100,:m)
t=FwU.new(10,Unit.s)
v=s/t
v → 10
v.unit → [[Unit.m, 1], [Unit.s, -1]]

any ideas to do this nicer?

but I don’t know this is wort bothering (does anyone really need this?)

Stony
(42)

···

Daniel Carrera dcarrera@math.umd.edu wrote:

I just added a Math/const module to RAA. It provides mathematical and
physical constants both in the MKS and CGS system.

======================================
The Answer is 42.
And I am the Answer.
Now I am looking for the Question.

From: Klaus Stein steink@ping.informatik.tu-muenchen.de

I also would like to do calculations on units, so that I can write:
s=FwU.new(100,Unit.m) # shold be shorter, perhaps: s=FwU(100,:m)
t=FwU.new(10,Unit.s)
v=s/t
v → 10
v.unit → [[Unit.m, 1], [Unit.s, -1]]

any ideas to do this nicer?

Try this:

http://raa.ruby-lang.org/list.rhtml?name=quanty

% irb -r quanty
irb(main):001:0> s=Quanty.new(100,“m”)
Quanty(100,‘m’)
irb(main):002:0> t=Quanty.new(10,“s”)
Quanty(10,‘s’)
irb(main):003:0> v=s/t
Quanty(10,‘m / s’)
irb(main):004:0> v.want(“km/hour”)
Quanty(36.0,‘km/hour’)

Masahiro Tanaka