comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Physical constants in IDL with !CONST
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Physical constants in IDL with !CONST [message #82576 is a reply to message #82525] Thu, 20 December 2012 12:31 Go to previous messageGo to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Hello,

On 12/20/12 14:10, Chris Torrence wrote:
> On Thursday, December 20, 2012 10:36:21 AM UTC-7, Heinz Stege wrote:
>
> Hi Heinz,
>
> That's a really good point. I had the same dilemma about "eV" when I
> put it in. I like your idea of getting rid of "e".

For what it's worth, I agree with Heinz. But for a (slightly) different
reason.

The symbol for elementary charge on the NIST site is "e". Thus that
should be what is used in !C.

Consistent adherence to a convention (in this case: all this stuff comes
from the NIST/CODATA site) is A Good Thing (tm).

> Also, yes, I'll make the "DtoR" and "RtoD" consistent. Maybe "DegRad"
> and "RadDeg", so at least they are somewhat human-readable?

I prefer the former to the latter simply because of the preposition "to"
indicating a direction of conversion.

<aside mode="tangential">
I've never been a big fan of making constant names short because people
want to save some keystrokes. In fact, that violates most
advice/conventions on naming in the usual texts ("Code Complete", "Clean
Code", etc etc)

I'm a verbose sort so the following is what I use:

REAL(fp), PARAMETER :: PI = 3.141592653589793238462643383279_fp
REAL(fp), PARAMETER :: TWOPI = TWO * PI
REAL(fp), PARAMETER :: DEGREES_TO_RADIANS = PI / 180.0_fp
REAL(fp), PARAMETER :: RADIANS_TO_DEGREES = 180.0_fp / PI

(I have similar in IDL code so I'm sure of the precision)

So if it's human readability you want, why not DEGREES_TO_RADIANS and
RADIANS_TO_DEGREES?

I realise just about everyone will disagree with me.

And that's o.k. :o)
</aside>


cheers,

paulv
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: What are the rules for automatic removal of singleton dimensions, and can I have a way of disabling them, please?
Next Topic: day or night

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Mon Dec 01 23:44:34 PST 2025

Total time taken to generate the page: 2.72454 seconds