Re: RE: Weirdness with symbol Degree vis Units
- To: mathgroup at smc.vnet.net
- Subject: [mg40684] Re: [mg40652] RE: [mg40616] Weirdness with symbol Degree vis Units
- From: Dr Bob <majort at cox-internet.com>
- Date: Sun, 13 Apr 2003 02:19:13 -0400 (EDT)
- References: <200304120710.DAA21297@smc.vnet.net>
- Reply-to: majort at cox-internet.com
- Sender: owner-wri-mathgroup at wolfram.com
>> In any case, WRI made a slip up because they used Degree both as a >> number constant and as a unit. Years ago, it was a slip up. By now, it's beyond that. It's not as if we haven't pointed out the problem a hundred times, and it's not as if it would be a really difficult fix. Oh well, live and don't learn... Let's all give David's package a look! Bobby On Sat, 12 Apr 2003 03:10:44 -0400 (EDT), David Park <djmp at earthlink.net> wrote: > Frank, > > I'm not certain if I totally understand your question. Did you use an N > somewhere to convert to approximate numbers? > > In any case, WRI made a slip up because they used Degree both as a number > constant and as a unit. The result is that if you try to use the Units > package to convert an approximate number to Degree, Degree is converted > back > to an approximate number and that immediately undoes the conversion! > > Needs["Miscellaneous`Units`"] > > The following works... > > Convert[6 Milli Radian, Degree] giving > (27*Degree)/(25*Pi) > > But if you try to convert an approximate number value... > > Convert[6.0 Milli Radian, Degree] > 0.006 > > and you are right back where you started. > > If you want to try the Miscellaneous`V4ExtendUnits package at my web site > below, it corrects the problem. > > Needs["Miscellaneous`V4ExtendUnits`"] > > 6.0 Milli Radian // ToUnit[Degree] > %//FullForm > 0.343775 ° > Times[0.34377467707849396`, HoldForm[Degree]] > > V4ExtendUnits converts to a fake degree and then puts the resulting > Degree > symbol in a HoldForm to prevent undoing the conversion. The package has > many > other features, including the ability to define and use your own units, > or > synonyms for standard unit expressions such as GeV for Giga ElectronVolt. > > David Park > djmp at earthlink.net > http://home.earthlink.net/~djmp/ > > > From: Frank Iannarilli [mailto:frankeye at cox.net] To: mathgroup at smc.vnet.net > To: mathgroup at smc.vnet.net > > 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/in > dex.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
- References:
- RE: Weirdness with symbol Degree vis Units
- From: "David Park" <djmp@earthlink.net>
- RE: Weirdness with symbol Degree vis Units