Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

BothSides.m

  • To: mathgroup at smc.vnet.net
  • Subject: [mg80060] BothSides.m
  • From: "AngleWyrm" <anglewyrm at yahoo.com>
  • Date: Sat, 11 Aug 2007 02:18:58 -0400 (EDT)

Here's a handy little package for working with equations.

Example in[1]:=

<<BothSides`
2 a/b - 4 == c // TraditionalForm
BothSides[Plus, 4]
BothSides[Times, b/2]

-----| BothSides.m |----
BeginPackage["BothSides`"]

BothSides::usage =
"BothSides[f,v] applies function f[v,%] to previous output.
BothSides[Plus,5] will add 5 to both sides of an expression."

BothSides[f_, v_] := Module[ {a = Apply[List, %]},
a = Thread[ f[v, a] ];
Apply[Equal, a]
];

EndPackage[ ] 




  • Prev by Date: Re: FourierTransform of Sign^2 ?
  • Next by Date: Re: frameticks and LogScale
  • Previous by thread: Re: Mathematica v5 versus v6
  • Next by thread: Re: BothSides.m