My generalization expands the type of function and their inputs.

- linear:
*slope*_{x}×*x*_{n}+*slope*_{y}×*y*_{n}+*constant*, or

- quadratic:
*slope*_{xx}×*x*_{n}^{2}+*slope*_{xy}×*x*_{n}×*y*_{n}+*slope*_{yy}×*y*_{n}^{2}+*slope*_{x}×*x*_{n}+*slope*_{y}×*y*_{n}+*constant*.

Unit circle and circular cosine & sine functions

When I first learned of these functions and their relationships to the circle, it seemed to me that their graphs should be circular. That is, if you plotted a full period of either, you should get four quarter-circles. That clearly isn't the case (and for good reasons), but that thought does invite investigation into other (probably less useful) functions. I call the first variation available in this formula the "superellipse" version. That's because plotting it gives four quarter superellipses--ellipses whose power is not necessarily 2. The graph below shows the superellipse version of the sine function for powers of 0.5, 1, and 2. In the coloring, you can choose any value from 0 on up.

Superellipse sine functions

The circular sine and cosine functions give the *x*- and *y*-coordinates of points on a circle (respectively). With a bit of effort, one can generate formulas for the coordinates of points on other shapes. My second variation, "polygonal," does that for regular polygons. As the number of sides increases, a regular polygon increasingly approaches a circle. In a similar fashion, the polygonal sine and cosine functions become indistinguishable from their circular counterparts as the number of sides increases. Conversely, the greatest differences between the two functions occur when the number of sides is the least, 3. The graph below shows the polygonal sine function for 3, 5, and 8 sides. In the coloring, you can specify at least 3 sides.

Polygonal sine functions

General parameters

- mode: the type of inputs: de Jong (default), linear, or quadratic
- trig mode: the type of trigonometric functions: standard (circular, default), superellipse, or polygonal
- power: for the superellipse trig mode, the superellipse power (any value can be used, but positive values will probably work better)
- sides: for the polygonal trig mode, the number of sides (integer, at least 3)
- initial value: the initial
*x*- and*y*-values. The real part of the parameter is the initial*x*-value and the imaginary part is the initial*y*-value.

*x*-cosine function

These parameters are repeated for the *x*-sine, *y*-cosine, and *y*-sine functions. Which specific parameters are shown depends on the modes chosen.

- frequency: for the de Jong mode, the
*a*(or*b*,*c*, or*d*) frequency value. - amplitude: for the linear and quadratic modes, scales the output of the function
- x^2 coefficient: for the quadratic mode, multiplies
*x*^{2}in the input; slope_{xx}above - x*y coefficient: for the quadratic mode, multiplies
*x*×*y*in the input; slope_{xy}above - y^2 coefficient: for the quadratic mode, multiplies
*y*^{2}in the input; slope_{yy}above - x slope: for the linear and quadratic modes, multiplies
*x*in the input; slope_{x}above - y slope: for the linear and quadratic modes, multiplies
*y*in the input; slope_{y}above - constant: for the linear and quadratic modes, added to the
*x*and*y*terms in the input

Drawing parameters

- sampling factor: determines how many points are used to draw the image. Set to a positive number; larger numbers use more memory and time.
- transients: how many times to iterate before drawing, to let the transients die out and just display the attractor
- frequency scaling: how the pixel hit counts are converted to colors. Choose from linear, logarithmic, and hyperbolic tangent.
- density: like the Color Density at the top of the Outside tab, but before the Outside Color Density is applied
- solid background?: check to use the Solid Color as the background color, instead of color 0 from the palette

- This is one of those coloring formulas that does all the work. It was designed to be used as an outside coloring with the “Pixel” formula in lkm.ucl.
- It works by storing a count of how many times each pixel is visited while the functions are iterated. Consequently, it can use a LOT of memory for big images and it doesn't work well with rendering-to-disk.
- Start small and simple until you get the hang of things. Use the de Jong mode and standard trig to start, with a sampling factor of 10 or less. Then venture into the funky stuff and increase the sampling factor as you develop some confidence.
- The hyperbolic tangent frequency scaling works best with the Repeat Gradient box cleared. Leave it checked when using the linear and logarithmic scaling modes.
- The Explore mode (crosshairs associated with each parameter's input) is a great way to get a sense of how to set the function parameters, particularly with the linear and quadratic modes.
- Not all function parameter settings will result in attractors. If you get a blank screen, Undo and make a smaller change.

Sample 1. This image uses the de Jong mode and the standard trig functions.

Sample 2. This image uses the linear mode and the superellipse trig functions.

Sample 3. This image uses the quadratic mode and the polygonal trig functions.

Enjoy!