Density Plots of Trig Expressions

Xah Lee, 2004-01

The following are density plots of arbitrary expressions of one term involving trig functions. The expression is printed on the lower right corner of the image.

The following is a moire pattern study.

Highe-resolution files in PDF or bitmap images are available for $5 each. Please send a check to Xah Lee, P O Box 390595, Mountain View, CA 94042-0290, USA. Or, contact me by email.


The following is Mathematica code that generates all possible equations of one term. (tweak the funList and nesting level to define what “all possible” means. if nesting level is 2, it takes about 5 minutes and returns a list of some 2000 terms on a 2002 personal computer.

<< DiscreteMath`Combinatorica`
funList = {Sin, Tan, Power[#, -1] &};
Nest[Module[{li = #},
        (Union[#, SameTest -> (Module[{arg1 = #1, arg2 = #2},
                        If[(*both expression contains both x and y*)
                          And @@ (((((StringMatchQ[#, "*x*"] && 
                                        StringMatchQ[#, "*y*"]) &)@
                                        ToString@#) &) /@ {arg1, arg2})
                          , SameQ[arg1, arg2 /. {x -> y, y -> x}], 
                          SameQ[arg1, arg2]]
                        ] &)] &)@
          Union@Flatten@(Table[(Times @@ # &) /@ KSubsets[#, i], {i, 1, 
                        2}] &)@Flatten@{li, Outer[#1@#2 &, funList, li]}
        ] &, {x, y}, 1];
Select[%, (StringMatchQ[ToString@#, "*x*"] && 
        StringMatchQ[ToString@#, "*y*"]) &]

Page Created:2004-01.
© 2004 by Xah Lee.
Xah Signet