[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: List of constants.
From: |
Muthiah Annamalai |
Subject: |
Re: List of constants. |
Date: |
Sat, 10 Feb 2007 15:42:08 -0600 |
On Sat, 2007-02-10 at 15:45 -0500, Paul Kienzle wrote:
> On Feb 9, 2007, at 6:56 AM, Muthiah Annamalai wrote:
>
> > Hello there,
> >
> > I was looking for some physical constant (Boltzmann Constant K),
> > lately, and thought if we had some inbuilt thing in Octave
<SNIP>
> > scripts-functions that return the value of constants.
>
> You don't want to add a new function for every constant.
>
Yes,
> How about having a function which can return the desired
> constant, or perhaps return a static structure containing
> all constants.
I think I have implemented something on the lines of what JWE, and David
said earlier today. It works like this:
1. physical_constant()
-returns the whole table as a structure.
2. physical_constant('speed_of_light')
-returns just the number.
3. [val,unit,uncert]=physical_constant('speed_of_light')
-returns other attributes.
It is a single pt entry to the constant list.
>
> Also, you might want to return a vector of exponents on
> the seven basic SI units rather than a string. With it you
> can do things such as scale between cgs and mks.
> - Paul
>
I think this can go into a units conversion package, when we have one,
for the moment, I'd like to keep it independent.
~ Muthiah