MathGroup Archive 2003

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Weirdness with symbol Degree vis Units

  • To: mathgroup at smc.vnet.net
  • Subject: [mg40655] Re: [mg40616] Weirdness with symbol Degree vis Units
  • From: Dr Bob <majort at cox-internet.com>
  • Date: Sat, 12 Apr 2003 03:11:01 -0400 (EDT)
  • References: <200304110602.CAA01975@smc.vnet.net>
  • Reply-to: majort at cox-internet.com
  • Sender: owner-wri-mathgroup at wolfram.com

It's a long-standing (and well-known) conflict between System`Degree and 
Miscellaneous`Units`Degree.

(The latter doesn't appear to exist at all, but it's documented as if it 
does.)

WRI has ignored this LONG ENOUGH.

In version 4.2.1, I get:

Needs["Miscellaneous`Units`"]
Convert[6 Milli Radian, Degree]
Convert[6 Milli Radian, 1/Degree]

(27*Degree)/(25*Pi)
Pi/(30000*Degree)

These are really the same, because System`Degree is a number equal to 
(Pi/180).

But you input "6.", not "6", and didn't tell us?  Right?  With that input I 
get the same as you.

All four answers are 6/1000 -- the original 6 milli-radians.  No conversion 
is occurring, because System`Degree isn't a unit (in the 
Miscellaneous`Units` sense).

The following inputs (in a new session) yield error messages:

Needs["Miscellaneous`Units`"]
Miscellaneous`Units`Degree
Convert[6 Milli Radian, Degree]
Convert[6 Milli Radian, 1/Degree]

Degree::"shdw":"Symbol \!\(\"Degree\"\) appears in multiple contexts \
\!\({\"Miscellaneous`Units`\", \"System`\"}\); definitions in context \
\!\(\"Miscellaneous`Units`\"\) may shadow or be shadowed by other \
definitions."

Degree

Convert::"incomp":"Incompatible units in \!\(6\\ Milli\\ Radian\) and \
\!\(Degree\)."

6 Milli Radian

\!\(Convert::"incomp" \(\(:\)\(\ \)\) "Incompatible units in \!\(6\\ 
Milli\\ Radian\) and \!\(1\/Degree\)."\)

6 Milli Radian

MENTIONING the Degree that should come from Miscellaneous`Units` (but 
doesn't) causes a shadowing situation, so that System`Degree is no longer 
seen by Convert.

Bobby

On Fri, 11 Apr 2003 02:02:17 -0400 (EDT), Frank Iannarilli 
<frankeye at cox.net> wrote:

> Hi,
>
> I threw myself for a loop, trying the following:
>
> Needs["Miscellaneous`Units`"]
>
> Convert[6 Milli Radian, Degree]
> > 0.006
>
> Convert[6 Milli Radian, 1/Degree]
> > 0.006
>
> (* Huh?? What's going on here?? *)
>
> Context[Degree]
> > System`
>
> N[Degree]
> > 0.0174533  (* same as it ever way... *)
>
> Oh, thought I...the Help Browser, when viewing the
> StandardAddons/Miscellaneous/Units, lists Degree as a units symbol for
> angle. So I'd better reference it with its context:
>
> Convert[6. Milli Radian, Miscellaneous`Units`Degree]
> > Convert::incomp : Incompatible units in 6 Milli Radian and
> Degree.
>
> N[Degree]
> > Degree  (* Huh?? *)
>
> It turns out that the Units package does NOT in fact introduce its own
> Degree symbol:  (reference:
> http://support.wolfram.com/mathematica/kernel/Symbols/Miscellaneous/Units/index.html) 
>
>
> .
>
> Nevertheless, I inadvertently introduced it myself with the most
> recent Convert[] invocation above.  So to get things back to "normal"
> I had to Remove it:
>
> Remove[Miscellaneous`Units`Degree]
>
> But now, notwithstanding the somewhat misleading documentation, my
> question still remains:  Why can't I have Convert[] give me an
> "non-surprising" behavior when attempting to convert to Degree?  Must
> I treat the Degree symbol as a special case, w.r.t. use of units?
>
> TIA!
>
>



-- 
majort at cox-internet.com
Bobby R. Treat



  • Prev by Date: Re: Opinions about the "Oneliners"
  • Next by Date: RE: Re: split a list
  • Previous by thread: Weirdness with symbol Degree vis Units
  • Next by thread: Re: Weirdness with symbol Degree vis Units