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[ ]