text:
Quartic equation

In mathematics, a quartic equation is one which can be expressed as a quartic function equaling zero. The general form of a quartic equation is

 * $$ax^4+bx^3+cx^2+dx+e=0 \,$$

where a ≠ 0.

The quartic is the highest order polynomial equation that can be solved by radicals in the general case (i.e., one in which the coefficients can take any value).

History
Lodovico Ferrari is attributed with the discovery of the solution to the quartic in 1540, but since this solution, like all algebraic solutions of the quartic, requires the solution of a cubic to be found, it could not be published immediately. The solution of the quartic was published together with that of the cubic by Ferrari's mentor Gerolamo Cardano in the book Ars Magna (1545).

The proof that this was the highest order general polynomial for which such solutions could be found was first given in the Abel–Ruffini theorem in 1824, proving that all attempts at solving the higher order polynomials would be futile. The notes left by Évariste Galois before his death in a duel in 1832 later led to an elegant complete theory of the roots of polynomials, of which this theorem was one result.

Solving a quartic equation, special cases
Consider a quartic equation expressed in the form $$a_0x^4+a_1x^3+a_2x^2+a_3x+a_4=0 $$:

There exists a general formula for finding the roots to quartic equations, provided the coefficient of the leading term is non-zero. However, since the general method is quite complex and susceptible to errors in execution, it is better to apply one of the special cases listed below if possible.

Degenerate case
If the constant term a4 = 0, then one of the roots is x = 0, and the other roots can be found by dividing by x, and solving the resulting cubic equation,
 * $$a_0x^3+a_1x^2+a_2x+a_3=0. \,$$

Evident roots: 1 and −1 and −$k$
Call our quartic polynomial $Q(x)$. Since 1 raised to any power is 1,
 * $$ Q(1) = a_0 + a_1 + a_2 + a_3 + a_4 \ .$$

Thus if $$\ a_0 + a_1 + a_2 + a_3 + a_4 = 0\ ,$$ $Q(1) = 0$ and so $x$ = 1 is a root of $Q(x)$. It can similarly be shown that if $$\ a_0 + a_2 + a_4 = a_1 + a_3 \ ,$$ $x$ = −1 is a root.

In either case the full quartic can then be divided by the factor $(x − 1)$ or $(x + 1)$ respectively yielding a new cubic polynomial, which can be solved to find the quartic's other roots.

If $$\ a_1 = a_0 k\ ,$$ $$\ a_2 = 0\ $$ and $$\ a_4= a_3 k\ ,$$ then $$\ x = -k\ $$ is a root of the equation. The full quartic can then be factorized this way:
 * $$\ a_0 x^4 + a_0 k x^3 + a_3 x + a_3 k = a_0 x^3 (x + k) + a_3 (x + k) = (a_0 x^3 + a_3) (x + k) \ .$$

Alternatively, if $$\ a_1 = a_0 k\ ,$$ $$\ a_3 = a_2 k\ ,$$ and $$\ a_4 = 0\ ,$$ then $x = 0$ and $x = −k$ become two known roots. $Q(x)$ divided by $x(x + k)$ is a quadratic polynomial.

Biquadratic equations
A quartic equation where a3 and a1 are equal to 0 takes the form

 * $$a_0x^4+a_2x^2+a_4=0\,\!$$

and thus is a biquadratic equation, which is easy to solve: let $$z=x^2$$, so our equation turns to

 * $$a_0z^2+a_2z+a_4=0\,\!$$

which is a simple quadratic equation, whose solutions are easily found using the quadratic formula:

 * $$z=\frac{-a_2\pm\sqrt{a_2^2-4a_0a_4}}{2a_0} \,\!$$

When we've solved it (i.e. found these two z values), we can extract x from them

 * $$x_1=+\sqrt{z_+}\,\!$$
 * $$x_2=-\sqrt{z_+}\,\!$$
 * $$x_3=+\sqrt{z_-}\,\!$$
 * $$x_4=-\sqrt{z_-}\,\!$$

If either of the z solutions were negative or complex numbers, then some of the x solutions are complex numbers.

Quasi-symmetric equations

 * $$a_0x^4+a_1x^3+a_2x^2+a_1 m x+a_0 m^2=0 \,$$

Steps:

 * 1) Divide by x2.
 * 2) Use variable change z = x + m/x.
 * So, z2 = x2 + (m/x)2 + 2m.

This leads to:

 * $$a_0(x^2+m^2/x^2) + a_1(x+m/x) + a_2=0$$,
 * $$a_0(z^2-2m) + a_1(z) + a_2=0$$,
 * $$z^2 + (a_1/a_0)z + (a_2/a_0-2m)=0$$ (a quadratic in z = x + m/x)

Multiple roots
If the quartic has a double root, it can be found by taking the polynomial greatest common divisor with its derivative. Then they can be divided out and the resulting quadratic equation solved.

In general, there exist only four possible cases of quartic equations with multiple roots, which are listed below:

 * 1) Multiplicity-4 (M4): when the general quartic equation can be expressed as $$a(x-l)^4=0$$, for some real number $$l$$. This case can always be reduced to a biquadratic equation.
 * 2) Multiplicity-3 (M3): when the general quartic equation can be expressed as $$a(x-l)^3 (x-m)=0$$, where $$l$$ and $$m$$ are a couple of two different real numbers. This is the only case that can never be reduced to a biquadratic equation.
 * 3) Double Multiplicity-2 (DM2): when the general quartic equation can be expressed as $$a(x-l)^2 (x-m)^2=0$$, where $$l$$ and $$m$$ are a couple of two different real numbers or a couple of non-real complex conjugate numbers. This case can also always be reduced to a biquadratic equation.
 * 4) Single Multiplicity-2 (SM2): when the general quartic equation can be expressed as $$a(x-l)^2 (x-m)(x-n)=0$$, where $$l$$, $$m$$, and $$n$$ are three different real numbers or $$l$$ is a real number and $$m$$ and $$n$$ are a couple of non-real complex conjugate numbers. This case is divided into two subcases, those that can be reduced to a biquadratic equation and those in which this is impossible.

So, if the three non-monic coefficients of the depressed quartic equation, $$x^4 + p x^2 + q x + r = 0$$, in terms of the five coefficients of the general quartic equation are given as follows: $$p=\frac{8ac-3b^2}{8a^2}$$, $$q=\frac{b^3-4abc+8a^2 d}{8a^3}$$ and $$r=\frac{16ab^2 c-64a^2 bd-3b^4+256a^3 e}{256a^4}$$, then the criteria to identify a priori each case of quartic equations with multiple roots and their respective solutions are exposed below.

 * M4. The general quartic equation corresponds to this case whenever $$p=q=r=0$$, so the four roots of this equation are given as follows: $$x_1=x_2=x_3=x_4=-\frac{b}{4a}$$.
 * M3. The general quartic equation corresponds to this case whenever $$p^2=-12r>0$$ and $$27q^2=-8p^3>0$$, so the four roots of this equation are given as follows: $$x_1=x_2=x_3=\sqrt{-\frac{p}{6}}-\frac{b}{4a}$$  and $$x_4=-\sqrt{-\frac{3p}{2}}-\frac{b}{4a}$$, whether $$q>0$$; otherwise, $$x_1=x_2=x_3=-\sqrt{-\frac{p}{6}}-\frac{b}{4a}$$  and $$x_4=\sqrt{-\frac{3p}{2}}-\frac{b}{4a}$$.
 * DM2. The general quartic equation corresponds to this case whenever $$p^2=4r>0=q$$, so the four roots of this equation are given as follows: $$x_1=x_3=\sqrt{-\frac{p}{2}}-\frac{b}{4a}$$ and $$x_2=x_4=-\sqrt{-\frac{p}{2}}-\frac{b}{4a}$$.
 * Biquadratic SM2. The general quartic equation corresponds to this subcase of the SM2 equations whenever $$p\neq q=r=0$$, so the four roots of this equation are given as follows: $$x_1=x_2=-\frac{b}{4a}$$, $$x_3=\sqrt{-p}-\frac{b}{4a}$$ and $$x_4=-\sqrt{-p}-\frac{b}{4a}$$.
 * Non-Biquadratic SM2. The general quartic equation corresponds to this subcase of the SM2 equations whenever $$(p^2+12r)^3=[p(p^2-36r)+\frac{27}{2} q^2 ]^2>0\neq {q}$$, so the four roots of this equation are given by the following formula: $$x=\frac{1}{2} \left [ \xi\sqrt{s_1}\pm\sqrt{2\biggl(s_2-\frac{\xi q}{\sqrt{s_1}}\biggr)} \right ]-\frac{b}{4a}$$, where $$s_1=\frac{9q^2-32pr}{p^2+12r}>0$$, $$s_2=-\frac{2p(p^2-4r)+9q^2}{2(p^2+12r)}\neq 0$$ and $$\xi = \pm 1$$.

The general case

To begin, the quartic must first be converted to a depressed quartic.

Converting to a depressed quartic
Let

be the general quartic equation which it is desired to solve. Divide both sides by $$,
 * $$\ x^4 + {B \over A} x^3 + {C \over A} x^2 + {D \over A} x + {E \over A} = 0 \ . $$

The first step, if $A$ is not already zero, should be to eliminate the $B$3 term. To do this, change variables from $x$ to $x$, such that
 * $$\ x = u - {B \over 4 A} \ .$$

Then
 * $$\ \left( u - {B \over 4 A} \right)^4 + {B \over A} \left( u - {B \over 4 A} \right)^3 + {C \over A} \left( u - {B \over 4 A} \right)^2 + {D \over A} \left( u - {B \over 4 A} \right) + {E \over A} = 0 \ .$$

Expanding the powers of the binomials produces
 * $$\ \left( u^4 - {B \over A} u^3 + {6 u^2 B^2 \over 16 A^2} - {4 u B^3 \over 64 A^3} + {B^4 \over 256 A^4} \right)

+ {B \over A} \left( u^3 - {3 u^2 B \over 4 A} + {3 u B^2 \over 16 A^2} - {B^3 \over 64 A^3} \right) + {C \over A} \left( u^2 - {u B \over 2 A} + {B^2 \over 16 A^2} \right) + {D \over A} \left( u - {B \over 4 A} \right) + {E \over A} = 0 \ .$$ Collecting the same powers of u yields
 * $$\ u^4 + \left( {-3 B^2 \over 8 A^2} + {C \over A} \right) u^2 + \left( {B^3 \over 8 A^3} - {B C \over 2 A^2} + {D \over A} \right) u + \left( {-3 B^4 \over 256 A^4} + {C B^2 \over 16 A^3} - {B D \over 4 A^2} + {E \over A} \right) = 0 \ .$$

Now rename the coefficients of $u$. Let

\begin{align} a & = {-3 B^2 \over 8 A^2} + {C \over A}\ ,\\ b & = {B^3 \over 8 A^3} - {B C \over 2 A^2} + {D \over A}\ ,\\ c & = {-3 B^4 \over 256 A^4} + {C B^2 \over 16 A^3} - {B D \over 4 A^2} + {E \over A}\. \end{align} $$ The resulting equation is

which is a depressed quartic equation.

If $$\ b = 0 \ $$ then we have the special case of a biquadratic equation, which is easily solved, as explained above. Note that the general solution, given below, will not work for the special case $$\ b = 0 \ .$$ The equation must be solved as a biquadratic.

In either case, once the depressed quartic is solved for $u$, substituting those values into
 * $$\ x = u - {B \over 4 A} \ $$

produces the values for $$ that solve the original quartic.

Solving a depressed quartic when $u$ ≠ 0
After converting to a depressed quartic equation
 * $$ u^4 + a u^2 + b u + c = 0 $$

and excluding the special case $x$ = 0, which is solved as a biquadratic, we assume from here on that $b$ ≠ 0.

We will separate the terms left and right as
 * $$ u^4 = - a u^2 - b u - c $$

and add in terms to both sides which make them both into perfect squares.

Let $b$ be any solution of this cubic equation:
 * $$ 2 y^3 - a y^2 - 2 c y + ( a c - \tfrac14 b^2 ) = ( 2 y - a ) ( y^2 - c ) - \tfrac14 b^2 = 0 \ .$$

Then (since $b$ ≠ 0)
 * $$ 2 y - a \neq 0 $$

so we may divide by it, giving
 * $$ y^2 - c = \frac{ b^2 }{ 4 ( 2 y - a ) } \ .$$

Then
 * $$ ( u^2 + y )^2 = u^4 + 2 y u^2 + y^2 = ( 2 y - a ) u^2 - b u + ( y^2 - c ) = ( 2 y - a ) u^2 - b u + \frac{ b^2 }{\ 4 ( 2 y - a )\ } = \left( \sqrt{ 2 y - a\ } \, u - \frac{ b }{ 2 \sqrt{ 2 y - a\ } } \right)^2 \ .$$

Subtracting, we get the difference of two squares which is the product of the sum and difference of their roots
 * $$ ( u^2 + y )^2 - \left( \sqrt{ 2 y - a\ } \, u - \frac{ b }{ 2 \sqrt{ 2 y - a\ } } \right)^2 = \left( u^2 + y + \sqrt{ 2 y - a\ } \, u - \frac{ b }{ 2 \sqrt{ 2 y - a\ } } \right) \left( u^2 + y - \sqrt{ 2 y - a\ } \, u + \frac{ b }{ 2 \sqrt{ 2 y - a\ } } \right) = 0 $$

which can be solved by applying the quadratic formula to each of the two factors. So the possible values of $y$ are:
 * $$ u = \tfrac12 \left( - \sqrt{ 2 y - a\ } + \sqrt{ -2 y - a + \frac{ 2 b }{ \sqrt{ 2 y - a\ } }\ } \right) \ ,$$
 * $$ u = \tfrac12 \left( - \sqrt{ 2 y - a\ } - \sqrt{ -2 y - a + \frac{ 2 b }{ \sqrt{ 2 y - a\ } }\ } \right) \ ,$$
 * $$ u = \tfrac12 \left( \sqrt{ 2 y - a\ } + \sqrt{ -2 y - a - \frac{ 2 b }{ \sqrt{ 2 y - a\ } }\ } \right) \ ,$$ or
 * $$ u = \tfrac12 \left( \sqrt{ 2 y - a\ } - \sqrt{ -2 y - a - \frac{ 2 b }{ \sqrt{ 2 y - a\ } }\ } \right) \ .$$

Using another $b$ from among the three roots of the cubic simply causes these same four values of $u$ to appear in a different order. The solutions of the cubic are:
 * $$\ y = \frac{a}{6} + w - \frac{p}{3 w}\ $$
 * $$\ w = \sqrt[3]{- \frac{q}{2} + \sqrt{ \frac{q^2}{4} + \frac{p^3}{27}\ }\ } $$

using any one of the three possible cube roots. A wise strategy is to choose the sign of the square-root that makes the absolute value of $y$ as large as possible.
 * $$\ p = - \frac{a^2}{12} - c \ ,$$
 * $$\ q = - \frac{a^3}{108} + \frac{a c}{3} - \frac{b^2}{8} \ .$$

Ferrari's solution
Otherwise, the depressed quartic can be solved by means of a method discovered by Lodovico Ferrari. Once the depressed quartic has been obtained, the next step is to add the valid identity
 * $$ \left(u^2 + a\right)^2 - u^4 - 2 a u^2 = a^2$$

to equation ($u$), yielding

The effect has been to fold up the u4 term into a perfect square: (u2 + a)2. The second term, au2 did not disappear, but its sign has changed and it has been moved to the right side.

The next step is to insert a variable y into the perfect square on the left side of equation ($w$), and a corresponding 2y into the coefficient of u2 in the right side. To accomplish these insertions, the following valid formulas will be added to equation ($$),

\begin{align} (u^2+a+y)^2-(u^2+a)^2 & = 2y(u^2+a)+ y^2\ \ \\  & = 2yu^2+2ya+y^2, \end{align} $$ and
 * $$ 0 = (a + 2 y) u^2 - 2 y u^2 - a u^2\,$$

These two formulas, added together, produce
 * $$ \left(u^2 + a + y\right)^2 - \left(u^2 + a\right)^2 = \left(a + 2 y\right) u^2 - a u^2 + 2 y a + y^2 \qquad \qquad (y\hbox{-insertion})\,$$

which added to equation ($$) produces
 * $$ \left(u^2 + a + y\right)^2 + b u + c = \left(a + 2 y\right) u^2 + \left(2 y a + y^2 + a^2\right).\,$$

This is equivalent to

The objective now is to choose a value for y such that the right side of equation ($$) becomes a perfect square. This can be done by letting the discriminant of the quadratic function become zero. To explain this, first expand a perfect square so that it equals a quadratic function:
 * $$ \left(s u + t\right)^2 = \left(s^2\right) u^2 + \left(2 s t\right) u + \left(t^2\right).\,$$

The quadratic function on the right side has three coefficients. It can be verified that squaring the second coefficient and then subtracting four times the product of the first and third coefficients yields zero:
 * $$ \left(2 s t\right)^2 - 4 \left(s^2\right) \left(t^2\right) = 0.\,$$

Therefore to make the right side of equation ($$) into a perfect square, the following equation must be solved:
 * $$ (-b)^2 - 4 \left(2 y + a\right) \left(y^2 + 2 y a + a^2 - c\right) = 0.\,$$

Multiply the binomial with the polynomial,
 * $$ b^2 - 4 \left(2 y^3 + 5 a y^2 + \left(4 a^2 - 2 c\right) y + \left(a^3 - a c\right)\right) = 0\,$$

Divide both sides by −4, and move the −b2/4 to the right,
 * $$ 2 y^3 + 5 a y^2

+ \left( 4 a^2 - 2 c \right) y + \left( a^3 - a c - \frac{b^2}{4} \right) = 0 $$ Divide both sides by 2,

This is a cubic equation in y. Solve for y using any method for solving such equations (e.g. conversion to a reduced cubic and application of Cardano's formula). Any of the three possible roots will do.

Folding the second perfect square
With the value for y so selected, it is now known that the right side of equation ($$) is a perfect square of the form
 * $$\left(s^2\right)u^2 + (2st)u + \left(t^2\right) = \left(\left(\sqrt{s^2}\right)u + {(2st) \over 2\sqrt{s^2}}\right)^2$$
 * (This is correct for both signs of square root, as long as the same sign is taken for both square roots. A ± is redundant, as it would be absorbed by another ± a few equations further down this page.)

so that it can be folded:
 * $$ (a + 2 y) u^2 + (- b) u + \left(y^2 + 2 y a + a^2 - c \right) = \left( \left(\sqrt{a + 2y}\right)u + {(-b) \over 2\sqrt{a + 2 y}} \right)^2.$$
 * Note: If b ≠ 0 then a + 2y ≠ 0. If b = 0 then this would be a biquadratic equation, which we solved earlier.

Therefore equation ($$) becomes

Equation ($$) has a pair of folded perfect squares, one on each side of the equation. The two perfect squares balance each other.

If two squares are equal, then the sides of the two squares are also equal, as shown by:

Collecting like powers of u produces

 * Note: The subscript s of $$\pm_s$$ and $$\mp_s$$ is to note that they are dependent.

Equation ($$) is a quadratic equation for u. Its solution is
 * $$u=\frac{\pm_s\sqrt{a + 2 y} \pm_t \sqrt{(a + 2y) - 4\left(a + y \pm_s {b \over 2\sqrt{a + 2 y}}\right)}}{2}.$$

Simplifying, one gets
 * $$u={\pm_s\sqrt{a + 2 y} \pm_t \sqrt{-\left(3a + 2y \pm_s {2b \over \sqrt{a + 2 y}} \right)} \over 2}.$$

This is the solution of the depressed quartic, therefore the solutions of the original quartic equation are

 * Remember: The two $$\pm_s$$ come from the same place in equation ($$), and should both have the same sign, while the sign of $$\pm_t$$ is independent.

Summary of Ferrari's method
Given the quartic equation

 * $$ A x^4 + B x^3 + C x^2 + D x + E = 0, \,$$

its solution can be found by means of the following calculations:

 * $$ a = - {3 B^2 \over 8 A^2} + {C \over A}, $$

 * $$ b = {B^3 \over 8 A^3} - {B C \over 2 A^2} + {D \over A}, $$

 * $$ c = - {3 B^4 \over 256 A^4} + {C B^2 \over 16 A^3} - {B D \over 4 A^2} + {E \over A}. $$

If $$\,b=0,$$ then

 * $$x=-{B\over 4A}\pm_s\sqrt{-a\pm_t\sqrt{a^2-4c}\over 2}\qquad \mbox{(for } b=0 \mbox{ only)}.$$

Otherwise, continue with

 * $$ P = - {a^2 \over 12} - c, $$

 * $$ Q = - {a^3 \over 108} + {a c \over 3} - {b^2 \over 8}, $$

 * $$ R = -{Q\over 2} \pm \sqrt{{Q^{2}\over 4}+{P^{3}\over 27}},$$

(either sign of the square root will do)

 * $$ U = \sqrt[3]{R},$$

(there are 3 complex roots, any one of them will do)

 * $$ y = - {5 \over 6} a + \begin{cases}U=0 &\to -\sqrt[3]{Q}\\U\ne 0, &\to U - {P\over 3U} ,\end{cases} \quad\quad\quad $$

 * $$W=\sqrt{ a + 2 y}$$

 * $$ x = - {B \over 4 A} + { \pm_s W \pm_t \sqrt{-\left(3a + 2 y \pm_s {2b\over W} \right) }\over 2 }.$$

 * The two ±s must have the same sign, the ±t is independent. To get all roots, compute x for ±s,±t = +,+ and for +,−; and for −,+ and for −,−. This formula handles repeated roots without problem.

Ferrari was the first to discover one of these labyrinthine solutions. The equation which he solved was

 * $$ x^4 + 6 x^2 - 60 x + 36 = 0 $$

which was already in depressed form. It has a pair of solutions which can be found with the set of formulas shown above.

Ferrari's solution in the special case of real coefficients
If the coefficients of the quartic equation are real then the nested depressed cubic equation ($$) also has real coefficients, thus it has at least one real root.

Furthermore the cubic function
 * $$ C(v) = v^3 + P v + Q,$$

where P and Q are given by ($$) has the properties that
 * $$ C\left({a \over 3}\right) = {-b^2 \over 8} < 0 $$ and

$$\lim_{v\to \infty} C(v) = \infty,$$ where a and b are given by ($$).

This means that ($$) has a real root greater than $$a \over 3$$, and therefore that ($$) has a real root greater than $$-a \over 2$$.

Using this root the term $$\sqrt{a + 2 y}$$ in ($$) is always real, which ensures that the two quadratic equations ($$) have real coefficients.

Obtaining alternative solutions the hard way
It could happen that one only obtained one solution through the formulae above, because not all four sign patterns are tried for four solutions, and the solution obtained is complex. It may also be the case that one is only looking for a real solution. Let x1 denote the complex solution. If all the original coefficients A, B, C, D and E are real—which should be the case when one desires only real solutions – then there is another complex solution x2 which is the complex conjugate of x1. If the other two roots are denoted as x3 and x4 then the quartic equation can be expressed as
 * $$ (x - x_1) (x - x_2) (x - x_3) (x - x_4) = 0, \,$$

but this quartic equation is equivalent to the product of two quadratic equations:

and

Since
 * $$ x_2 = x_1^\star $$

then

\begin{align} (x-x_1)(x-x_2)&=x^2-(x_1+x_1^\star)x+x_1x_1^\star \\ &=x^2-2\operatorname{Re}(x_1)x+[\operatorname{Re}(x_1)]^2+[\operatorname{Im}(x_1)]^2. \end{align} $$

Let
 * $$ a = - 2\operatorname{Re}(x_1), $$
 * $$ b = \left[ \operatorname{Re}( x_1) \right]^{2} + \left[ \operatorname{Im}(x_1) \right]^{2} $$

so that equation ($$) becomes

Also let there be (unknown) variables w and v such that equation ($$) becomes

Multiplying equations ($$) and ($$) produces

Comparing equation ($$) to the original quartic equation, it can be seen that
 * $$ a + w = {B \over A}, $$
 * $$ b + w a + v = {C \over A}, $$
 * $$ w b + v a = {D \over A}, $$

and
 * $$ v b = {E \over A}. $$

Therefore
 * $$ w = {B \over A} - a = {B \over A} + 2 \operatorname{Re}(x_1), $$
 * $$ v = {E \over A b} = \frac{E}{A \left( \left[ \operatorname{Re}(x_1) \right]^2 + \left[ \operatorname{Im}(x_1) \right]^2 \right) }. $$

Equation ($$) can be solved for x yielding
 * $$ x_3 = {-w + \sqrt{w^2 - 4 v} \over 2}, $$
 * $$ x_4 = {-w - \sqrt{w^2 - 4 v} \over 2}. $$

One of these two solutions should be the desired real solution.

Quick and memorable solution from first principles
Most textbook solutions of the quartic equation require a substitution that is hard to memorize. Here is an approach that makes it easy to understand. The job is done if we can factor the quartic equation into a product of two quadratics. Let

\begin{align} 0 &= x^4 + bx^3 + cx^2 + dx + e \\ &= \left(x^2 + px + q\right)\left(x^2 + rx + s\right) \\ &= x^4 + (p + r)x^3 + (q + s + pr)x^2 + (ps + qr)x + qs \end{align} $$

By equating coefficients, this results in the following set of simultaneous equations:

\begin{align} b & = p + r \\ c & = q + s + pr \\ d & = ps + qr \\ e & = qs \end{align} $$

This is harder to solve than it looks, but if we start again with a depressed quartic where $$b = 0$$, which can be obtained by substituting $$(x - b/4)$$ for $$x$$, then $$r = -p$$, and:

\begin{align} c + p^2 & = s + q \\ d/p & = s - q \\ e & = sq \end{align} $$

It's now easy to eliminate both $$s$$ and $$q$$ by doing the following:

\begin{align} \left(c + p^2\right)^2 - (d/p)^2 & = (s + q)^2 - (s - q)^2 \\ & = 4sq \\ & = 4e \end{align} $$

If we set $$P = p^2$$, then this equation turns into the cubic equation:
 * $$P^3 + 2cP^2 + \left(c^2 - 4e\right)P - d^2 = 0$$

which is solved elsewhere. Once you have $$p$$, then:

\begin{align} r & = -p \\ 2s & = c + p^2 + d/p \\ 2q & = c + p^2 - d/p \end{align} $$

The symmetries in this solution are easy to see. There are three roots of the cubic, corresponding to the three ways that a quartic can be factored into two quadratics, and choosing positive or negative values of $$p$$ for the square root of $$P$$ merely exchanges the two quadratics with one another.

Galois theory and factorization
The symmetric group S4 on four elements has the Klein four-group as a normal subgroup. This suggests using a resolvent whose roots may be variously described as a discrete Fourier transform or a Hadamard matrix transform of the roots. Suppose ri for i from 0 to 3 are roots of
 * $$x^4 + bx^3 + cx^2 + dx + e = 0\qquad (1)$$

If we now set
 * $$ \begin{align}

s_0 &= \tfrac12(r_0 + r_1 + r_2 + r_3), \\ s_1 &= \tfrac12(r_0 - r_1 + r_2 - r_3), \\ s_2 &= \tfrac12(r_0 + r_1 - r_2 - r_3), \\ s_3 &= \tfrac12(r_0 - r_1 - r_2 + r_3), \end{align}$$ then since the transformation is an involution, we may express the roots in terms of the four si in exactly the same way. Since we know the value s0 = −b/2, we really only need the values for s1, s2 and s3. These we may find by expanding the polynomial
 * $$\left(z^2 - s_1^2\right)\left(z^2-s_2^2\right)\left(z^2-s_3^2\right)\qquad (2)$$

which if we make the simplifying assumption that b = 0, is equal to
 * $$z^6 + 2cz^4 + \left(c^2-4e\right) z^2 - d^2 \qquad(3)$$

This polynomial is of degree six, but only of degree three in z2, and so the corresponding equation is solvable. By trial we can determine which three roots are the correct ones, and hence find the solutions of the quartic.

We can remove any requirement for trial by using a root of the same resolvent polynomial for factoring; if w is any root of (3), and if

 * $$F_1 = x^2+wx+\frac 1 2 w^2+\frac 1 2 c - \frac 1 2\cdot \frac {c^2 w}{d}-\frac 1 2 \cdot\frac {w^5}{d} - \frac{cw^3}{d} + 2\frac {ew}{d}$$
 * $$F_2 = x^2-wx + \frac 1 2 w^2 + \frac 1 2 c + \frac 1 2\cdot \frac{w^5}{d} + \frac {cw^3}{d} - 2\frac {ew}{d} + \frac 1 2\cdot \frac {c^2 w}{d}$$

then

 * $$F_1 F_2 = x^4 + cx^2 + dx + e\qquad\qquad (4)$$

We therefore can solve the quartic by solving for w and then solving for the roots of the two factors using the quadratic formula.

Approximate methods
The methods described above are, in principle, exact root-finding methods. It is also possible to use successive approximation methods which iteratively converge towards the roots, such as the Durand–Kerner method. Iterative methods are the only ones available for quintic and higher-order equations, beyond trivial or special cases.

title: Quartic equation


text:
Georges Pompidou

Georges Jean Raymond Pompidou (, ; 5 July 1911 –2 April 1974) was a French politician who served as President of France from 1969 to his death in 1974. He was earlier the longest-ever Prime Minister of France, under President Charles de Gaulle, from 1962 to 1968.

In the context of the strong growth of the last years of the Trente Glorieuses, Pompidou continued De Gaulle's policy of modernisation, which was symbolised by the presidential use of the Concorde, the creation of large industrial groups and the launch of the high-speed train project (TGV). The government invested heavily in the automobile, agribusiness, steel, telecommunications, nuclear and aerospace sectors and also created the minimum wage (SMIC) and the Ministry of the Environment.

His foreign policy was pragmatic but in line with the Gaullist principle of French independence. It was marked by a warming of relations with Richard Nixon's United States, close relations with Leonid Brezhnev's Soviet Union, the launch of the snake in the tunnel and the relaunching of European construction by facilitating the United Kingdom's entry to the EEC in contrast to de Gaulle's opposition. Pompidou died in office in 1974 of Waldenström's disease, a rare form of blood cancer.

An admirer of contemporary art, Pompidou's name remains known worldwide for the Centre Pompidou, which he initiated and was inaugurated in 1977; it subsequently spread the name with its branches in Metz (France), Málaga (Spain), Brussels (Belgium) and Shanghai (China). A Georges Pompidou Museum is also dedicated to him in his hometown.

Early life
The family of Georges Pompidou was of very modest origins. He was the grandson of farmers of modest means in Cantal on both his father's and his mother's side. His parents were teachers. His case is thus often cited as a typical example of social mobility in the Third Republic because of public schooling.

Georges Jean Raymond Pompidou was born on 5 July 1911 in the commune of Montboudif, in the department of Cantal, in south-central France. After his hypokhâgne at Lycée Pierre-de-Fermat and his khâgne at Lycée Louis-le-Grand, where he befriended the future Senegalese poet and statesman Léopold Sédar Senghor, Pompidou attended the École Normale Supérieure from which he graduated with a degree of agrégation in literature.

He first taught literature at the lycée Henri IV in Paris until he was hired in 1953 by Guy de Rothschild to work at Rothschild. In 1956, he was appointed the bank's general manager, a position that he held until 1962. Later, he was hired by Charles de Gaulle to manage the Anne de Gaulle Foundation for Down syndrome (de Gaulle's youngest daughter, Anne, had Down syndrome).

Prime Minister
Jacques Chirac served as an aide to Prime Minister Pompidou and recalled:

"The man gave the appearance of being secretive, wily, a little cunning—which he was, to a degree. However, it was primarily his intelligence, culture, and competence that conferred indisputable authority on him and commanded respect.... I remember his untamed eyebrows, his penetrating, very kindly gaze, his perceptive smile, full of humour and mischievousness, his voice with its wonderful low, warm, gravelly tone, and a figure that was both powerful and elegant. Naturally reserved, little given to emotional outbursts, Pompidou did not forge very close ties with his colleagues." He served as prime minister of France under de Gaulle after Michel Debré resigned, from 14 April 1962 to 10 July 1968, and to this day is the longest serving French prime minister under the Fifth Republic. His nomination was controversial because he was not a member of the National Assembly. In October 1962, he was defeated in a vote of no-confidence, but de Gaulle dissolved the National Assembly. The Gaullists won the legislative election and Pompidou was reappointed as Prime Minister. In 1964, he was faced with a miners' strike. He led the 1967 legislative campaign of the Union of Democrats for the Fifth Republic to a narrow victory. Pompidou was widely regarded as being responsible for the peaceful resolution of the student uprising of May 1968. His strategy was to break the coalition of students and workers by negotiating with the trade-unions and employers (Grenelle conference).

During the events of May 1968, disagreements arose between Pompidou and de Gaulle. Pompidou did not understand why the President did not inform him of his departure to Baden-Baden on 29 May. Their relationship, until then very good, would be strained from then on. Pompidou led and won the 1968 legislative campaign, overseeing a tremendous victory of the Gaullist Party. He then resigned. Nevertheless, in part due to his actions during the May 1968 crisis, he appeared as the natural successor to de Gaulle. Pompidou announced his candidature for the Presidency in January 1969.

In social policy, Pompidou's tenure as prime minister witnessed the establishment of the National Employment Fund in 1963 to counter the negative effects on employment caused by industrial restructuring.

Presidency
After the failure of the 1969 constitutional referendum, de Gaulle resigned and Pompidou was elected president of France. In the general election of 15 June 1969, he defeated the centrist President of the Senate and Acting President Alain Poher by a wide margin (58% to 42%). Though a Gaullist, Pompidou was more pragmatic than de Gaulle, notably facilitating the accession of the United Kingdom to the European Community on 1 January 1973. He embarked on an industrialisation plan and initiated the Arianespace project, as well as the TGV project, and furthered the French civilian nuclear programme. He was sceptical about the "New Society" programme of his prime minister, Jacques Chaban-Delmas. In 1972, he replaced Chaban-Delmas with Pierre Messmer, a more conservative Gaullist. While the left-wing opposition organised itself and proposed a Common Programme before the 1973 legislative election, Pompidou widened his presidential majority by including Centrist pro-European parties. In addition, he paid special attention to regional and local needs in order to strengthen his political party, the UDR (Union des Democrates pour la Ve République), which he made a central and lasting force in the Gaullist movement.

Foreign affairs
The United States was eager to restore positive relations with France after de Gaulle's departure from office. New US President Richard Nixon and his top adviser Henry Kissinger admired Pompidou; the politicians were in agreement on most major policy issues. The United States offered to help the French nuclear programme. Economic difficulties, however, arose following the Nixon Shock and the 1973–1975 recession, particularly over the role of the American dollar as the medium for world trade.

Pompidou sought to maintain good relations with the newly independent former French colonies in Africa. In 1971, he visited Mauritania, Senegal, Ivory Coast, Cameroon, and Gabon. He brought a message of cooperation and financial assistance, but without the traditional paternalism. More broadly, he made an effort to foster closer relations with North African and Middle Eastern countries in order to develop a hinterland including all nations bordering the Mediterranean.

Modernising Paris
Pompidou's time in office was marked by constant efforts to modernise France's capital city. He spearheaded construction of a modern art museum, the Centre Beaubourg (renamed Centre Pompidou after his death), on the edge of the Marais area of Paris. Other attempts at modernisation included tearing down the open-air markets at Les Halles and replacing them with the shopping mall of the same name, building the Montparnasse Tower, and constructing an expressway on the right bank of the Seine.

Death in office
While still in office, Pompidou died on 2 April 1974, at 9 PM, while in his apartment, from Waldenström macroglobulinemia. His body was buried on 4 April, in the churchyard of Orvilliers, where he had bought an old baker's house which he turned into a weekend home. The official memorial service for him was held at Notre-Dame de Paris with 3,000 dignitaries in attendance (including 28 heads of state and representatives from 82 countries). April 6 was declared a national day of mourning and entertainment and cultural events were canceled, theatres and schools closed.

Attendees included: • 🇺🇳 United Nations Secretary General Kurt Waldheim

• UNESCO Director General René Maheu

• 🇪🇺 European Union President of the European Commission Jean Rey

•  NATO Secretary General Joseph Luns

• 🇫🇷 France (Interim) President Alain Poher

• 🇺🇸 United States President Richard Nixon

• 🇨🇦 Canada Prime Minister Pierre Trudeau

• 🇬🇧 United Kingdom Prime Minister Harold Wilson and predecessor Edward Heath

•  West Germany Chancellor Willy Brandt

•  East Germany Vice President Manfred Gerlach

• 🇦🇹 Austria Chancellor Bruno Kreisky

• 🇨🇭 Switzerland President Hans-Peter Tschudi

• 🇲🇦 Morocco King Hassan II

• 🇧🇪 Belgium King Baudouin

• 🇳🇱 Netherlands Queen Juliana

• 🇪🇹 Ethiopia Emperor Haile Selassie

• 🇹🇳 Tunisia President Habib Bourguiba

• 🇮🇹 Italy President Giovanni Leone

• 🇹🇷 Turkey Prime Minister Bülent Ecevit

• 🇫🇮 Finland President Urho Kekkonen

•  Soviet Union President Nikolai Podgorny

•  Yugoslavia Prime Minister Petar Stambolić

•  Czechoslovakia President Gustáv Husák

• 🇩🇰 Denmark Prime Minister Poul Hartling

• 🇸🇪 Sweden Prime Minister Olof Palme

• 🇵🇹 Portugal President Américo Tomás

• 🇪🇸 Spain Crown Prince Juan Carlos I of Spain

• 🇲🇨 Monaco Prince Rainier III

• 🇱🇺 Luxembourg Grand Duke Jean

• 🇯🇵 Japan Prime Minister Kakuei Tanaka

• 🇰🇷 South Korea Prime Minister Kim Jong-pil

•  North Vietnam Foreign Minister Nguyễn Duy Trinh

•  South Vietnam President Nguyễn Văn Thiệu A controversy arose surrounding the secrecy kept over Pompidou's illness, and the political class agreed that future presidents of the Republic would have to provide reports on the state of their health; however, President François Mitterrand, who had pledged during his 1981 campaign to publish regular health bulletins, would also conceal, after his accession to power, the severity of the cancer from which he was suffering.

Pompidou's wife Claude Pompidou would outlive him by more than thirty years. The couple had one (adopted) son, Alain Pompidou, who went on to serve as president of the European Patent Office. France withdrew from the Eurovision Song Contest 1974, which took place just four days after Pompidou's death, as a mark of respect.

Works

 * Anthologie de la Poésie Française, Livre de Poche/Hachette, 1961
 * Le Nœud gordien, éd. Plon, 1974
 * Entretiens et discours, deux vol., éd. Plon, 1975
 * Pour rétablir une vérité, éd. Flammarion, 1982

Medals

 * Legion of Honour:
 * Chevalier de la Legion of Honour: (France) (1948)
 * Officier de la Legion of Honour: (France) (1957)
 * Grand-croix de la Legion of Honour: 1969, grand-maître de l'ordre (France) (1969–1974, as president of the republic)
 * Grand-croix de l'Ordre national du Mérite (France);
 * Grand Cross of Order of St. Olav (Norway, 1962)
 * Knight Grand Cross Order of St. Sylvester (Vatican City, 1964)
 * Grand Cross of the Sovereign Military Order of Malta (1969)
 * Knight Grand Cross Order of the Netherlands Lion (Nederland, 1969)
 * Grand Cordon of Order of Leopold (Belgium, 1972)
 * First Class of the Star of the Republic of Indonesia (Indonesia, 1972)
 * Grand Cross of the Order of the Gold Lion of the House of Nassau (Luxembourg, 1972)
 * Grand Cordon of the Order of Polonia Restituta (Poland, 1972)
 * Honorary Knight Grand Cross of the Order of the Bath (United Kingdom, 1972)
 * Grand Cordon of the Order of Independence (Tunisia, 1972)
 * Knight Grand Cross with Collar of Order of Merit of the Italian Republic (Italy, 1973)

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

title: Georges Pompidou


text:
User:Cyp/Java

=Polyhedra.html=

'''For drawing an old version of the polyhedrons at platonic solid and archimedean solid. Can't draw the ones at catalan solid.''' Polyhedra

=Polyhedra.java=

import java.awt.*; import java.applet.*;

//-a,-b,-c, -a,-b,c, -a,b,-c, -a,b,c, a,-b,-c, a,-b,c, a,b,-c, a,b,c, //-c,-a,-b, -c,-a,b, -c,a,-b, -c,a,b, c,-a,-b, c,-a,b, c,a,-b, c,a,b, //-b,-c,-a, -b,-c,a, -b,c,-a, -b,c,a, b,-c,-a, b,-c,a, b,c,-a, b,c,a,

public class Polyhedra extends Applet{ double g=1.6180339887498948482045868343656381177203; //(1+Math.sqrt(5))/2; double d=0.6180339887498948482045868343656381177203; //1/g; double s=1.4142135623730950488016887242096980785696; //Math.sqrt(2); double q=2.6180339887498948482045868343656381177203; //(1+Math.sqrt(5))/2+1; double j=3.2360679774997896964091736687312762354406; //(1+Math.sqrt(5)); double w=(Math.pow(Math.sqrt(297)+17, 1/3.)-Math.pow(Math.sqrt(297)-17, 1/3.)-1)/3; //w+w*w+w*w*w==1 double w2=Math.pow((g+Math.sqrt(g-5/27.))/2, 1/3.)+Math.pow((g-Math.sqrt(g-5/27.))/2, 1/3.); //w2*w2*w2-2*w2==g double aa=w2-1/w2; double bb=w2*g+q+g/w2; double tetrav[]={ -1,-s,0, -1,s,0, 1,0,-s, 1,0,s}; int tetrat[]={ 0,1,3, 3,1,2, 1,0,2, 3,2,0}; double hexav[]={ -1,-1,-1, -1,-1,1, -1,1,-1, -1,1,1, 1,-1,-1, 1,-1,1, 1,1,-1, 1,1,1}; int hexat[]={ 0,2,3,1, 2,6,7,3, 0,4,6,2, 3,7,5,1, 0,1,5,4, 6,4,5,7}; double octav[]={ -1,0,0, 1,0,0, 0,-1,0, 0,1,0, 0,0,-1, 0,0,1}; int octat[]={ 0,4,3, 3,4,1, 1,4,2, 2,4,0, 3,5,0, 0,5,2, 2,5,1, 1,5,3}; double dodecav[]={ 0,-d,-g, 0,-d,g, 0,d,-g, 0,d,g, -d,-g,0, -d,g,0, d,-g,0, d,g,0, -g,0,-d, g,0,-d, -g,0,d, g,0,d, -1,-1,-1, -1,-1,1, -1,1,-1, -1,1,1, 1,-1,-1, 1,-1,1, 1,1,-1, 1,1,1}; int dodecat[]={ 0,2,14,8,12, 0,16,9,18,2, 4,6,16,0,12, 2,18,7,5,14, 13,4,12,8,10, 6,17,11,9,16, 15,10,8,14,5, 18,9,11,19,7, 1,17,6,4,13, 5,7,19,3,15, 13,10,15,3,1, 19,11,17,1,3}; double icosav[]={ 0,-1,-g, 0,-1,g, 0,1,-g, 0,1,g, -1,-g,0, -1,g,0, 1,-g,0, 1,g,0, -g,0,-1, g,0,-1, -g,0,1, g,0,1}; int icosat[]={ 0,2,8, 2,0,9, 4,0,8, 4,6,0, 6,9,0, 5,8,2, 5,2,7, 7,2,9, 10,4,8, 10,8,5, 6,11,9, 9,11,7, 10,5,3, 10,1,4, 1,11,6, 3,7,11, 1,6,4, 3,5,7, 3,11,1, 1,10,3}; double icosidodecav[]={ -j,0,0, j,0,0, 0,-j,0, 0,j,0, 0,0,-j, 0,0,j, -1,-g,-q, -1,-g,q, -1,g,-q, -1,g,q, 1,-g,-q, 1,-g,q, 1,g,-q, 1,g,q, -g,-q,-1, -g,q,-1, g,-q,-1, g,q,-1, -g,-q,1, -g,q,1, g,-q,1, g,q,1, -q,-1,-g, q,-1,-g, -q,-1,g, q,-1,g, -q,1,-g, q,1,-g, -q,1,g, q,1,g }; int icosidodecat[]={ 3,17,21,3, 3,27,23,1, 3,1,25,29, 3,21,29,13, 3,12,27,17, 3,10,16,23, 3,20,11,25, 3,9,13,5, 3,19,9,28, 3,26,8,15, 3,15,3,19, 3,7,5,11, 3,18,24,7, 3,2,14,18, 3,2,20,16, 3,4,6,10, 3,6,22,14, 3,8,4,12, 3,0,22,26, 3,0,28,24, 5,17,27,1,29,21, 5,1,23,16,20,25, 5,4,10,23,27,12, 5,5,13,29,25,11, 5,3,21,13,9,19, 5,8,12,17,3,15, 5,0,26,15,19,28, 5,24,28,9,5,7, 5,0,24,18,14,22, 5,2,18,7,11,20, 5,10,6,14,2,16, 5,8,26,22,6,4 }; double cuboctav[]={ -1,-1,0, -1,1,0, 1,-1,0, 1,1,0, 0,-1,-1, 0,-1,1, 0,1,-1, 0,1,1, -1,0,-1, 1,0,-1, -1,0,1, 1,0,1 }; int cuboctat[]={ 3,3,11,7, 3,9,3,6, 3,11,2,5, 3,4,2,9, 3,7,10,1, 3,1,8,6, 3,0,10,5, 3,4,8,0, 4,3,9,2,11, 4,11,5,10,7, 4,7,1,6,3, 4,10,0,8,1, 4,6,8,4,9, 4,4,0,5,2 }; double truncicosav[]={ 0,-1,-3*g, 0,-1,3*g, 0,1,-3*g, 0,1,3*g, -3*g,0,-1, 3*g,0,-1, -3*g,0,1, 3*g,0,1, -1,-3*g,0, -1,3*g,0, 1,-3*g,0, 1,3*g,0,

-2,-(g+q),-g, -2,-(g+q),g, -2,(g+q),-g, -2,(g+q),g, 2,-(g+q),-g, 2,-(g+q),g, 2,(g+q),-g, 2,(g+q),g, -g,-2,-(g+q), g,-2,-(g+q), -g,-2,(g+q), g,-2,(g+q), -g,2,-(g+q), g,2,-(g+q), -g,2,(g+q), g,2,(g+q), -(g+q),-g,-2, -(g+q),g,-2, (g+q),-g,-2, (g+q),g,-2, -(g+q),-g,2, -(g+q),g,2, (g+q),-g,2, (g+q),g,2,

-1,-(2+g),-2*g, -1,-(2+g),2*g, -1,(2+g),-2*g, -1,(2+g),2*g, 1,-(2+g),-2*g, 1,-(2+g),2*g, 1,(2+g),-2*g, 1,(2+g),2*g, -2*g,-1,-(2+g), 2*g,-1,-(2+g), -2*g,-1,(2+g), 2*g,-1,(2+g), -2*g,1,-(2+g), 2*g,1,-(2+g), -2*g,1,(2+g), 2*g,1,(2+g), -(2+g),-2*g,-1, -(2+g),2*g,-1, (2+g),-2*g,-1, (2+g),2*g,-1, -(2+g),-2*g,1, -(2+g),2*g,1, (2+g),-2*g,1, (2+g),2*g,1 }; int truncicosat[]={ 6,9,11,19,43,39,15, 6,55,31,5,7,35,59, 6,27,43,19,59,35,51, 6,11,9,14,38,42,18, 6,20,44,28,52,12,36, 6,0,2,24,48,44,20, 6,48,24,38,14,53,29, 6,0,21,45,49,25,2, 6,12,8,10,16,40,36, 6,18,42,25,49,31,55, 6,23,47,34,58,17,41, 6,1,3,27,51,47,23, 6,21,40,16,54,30,45, 6,7,5,30,54,58,34, 6,39,26,50,33,57,15, 6,3,1,22,46,50,26, 6,57,33,6,4,29,53, 6,6,32,56,52,28,4, 6,22,37,13,56,32,46, 6,37,41,17,10,8,13, 5,59,19,11,18,55, 5,35,7,34,47,51, 5,3,26,39,43,27, 5,44,48,29,4,28, 5,20,36,40,21,0, 5,38,24,2,25,42, 5,14,9,15,57,53, 5,10,17,58,54,16, 5,22,1,23,41,37, 5,49,45,30,5,31, 5,50,46,32,6,33, 5,13,8,12,52,56 }; double trunctetrav[]={ 3,1,1, 1,3,1, 1,1,3, 3,-1,-1, -1,3,-1, -1,-1,3,  -3,-1,1, 1,-3,-1, -1,1,-3,  -3,1,-1, -1,-3,1, 1,-1,-3 };  int trunctetrat[]={ 6,11,3,0,1,4,8, 6,3,7,10,5,2,0, 6,6,10,7,11,8,9, 6,9,4,1,2,5,6, 3,0,2,1, 3,8,4,9, 3,6,5,10, 3,7,3,11 }; double trunchexav[]={ -(s-1),-1,-1, -(s-1),-1,1, -(s-1),1,-1, -(s-1),1,1, (s-1),-1,-1, (s-1),-1,1, (s-1),1,-1, (s-1),1,1, -1,-(s-1),-1, 1,-(s-1),-1, -1,-(s-1),1, 1,-(s-1),1, -1,(s-1),-1, 1,(s-1),-1, -1,(s-1),1, 1,(s-1),1, -1,-1,-(s-1), -1,1,-(s-1), 1,-1,-(s-1), 1,1,-(s-1), -1,-1,(s-1), -1,1,(s-1), 1,-1,(s-1), 1,1,(s-1) }; int trunchexat[]={ 8,5,22,18,4,0,16,20,1, 8,21,14,10,20,16,8,12,17, 8,14,3,7,15,11,5,1,10, 8,6,19,23,7,3,21,17,2, 8,0,4,9,13,6,2,12,8, 8,13,9,18,22,11,15,23,19, 3,11,22,5, 3,18,9,4, 3,3,14,21, 3,2,17,12, 3,10,1,20, 3,7,23,15, 3,13,19,6, 3,0,8,16 }; double truncoctav[]={ -2,-1,0, -2,1,0, 2,-1,0, 2,1,0, 0,-2,-1, 0,-2,1, 0,2,-1, 0,2,1, -1,0,-2, 1,0,-2, -1,0,2, 1,0,2, -1,-2,0, -1,2,0, 1,-2,0, 1,2,0, 0,-1,-2, 0,-1,2, 0,1,-2, 0,1,2, -2,0,-1, 2,0,-1, -2,0,1, 2,0,1 }; int truncoctat[]={ 6,17,11,23,2,14,5, 6,14,2,21,9,16,4, 6,7,15,3,23,11,19, 6,0,12,4,16,8,20, 6,19,10,22,1,13,7, 6,17,5,12,0,22,10, 6,1,20,8,18,6,13, 6,6,18,9,21,3,15, 4,12,5,14,4, 4,2,23,3,21, 4,13,6,15,7, 4,8,16,9,18, 4,0,20,1,22, 4,11,17,10,19 }; double truncdodecav[]={ (0),-(3-g),-(5*g), (0),-(3-g),(5*g), (0),(3-g),-(5*g), (0),(3-g),(5*g), -(5*g),(0),-(3-g), (5*g),(0),-(3-g), -(5*g),(0),(3-g), (5*g),(0),(3-g), -(3-g),-(5*g),(0), -(3-g),(5*g),(0), (3-g),-(5*g),(0), (3-g),(5*g),(0),

-(3-g),-(2+g),-(4+2*g), -(3-g),-(2+g),(4+2*g), -(3-g),(2+g),-(4+2*g), -(3-g),(2+g),(4+2*g), (3-g),-(2+g),-(4+2*g), (3-g),-(2+g),(4+2*g), (3-g),(2+g),-(4+2*g), (3-g),(2+g),(4+2*g), -(4+2*g),-(3-g),-(2+g), (4+2*g),-(3-g),-(2+g), -(4+2*g),-(3-g),(2+g), (4+2*g),-(3-g),(2+g), -(4+2*g),(3-g),-(2+g), (4+2*g),(3-g),-(2+g), -(4+2*g),(3-g),(2+g), (4+2*g),(3-g),(2+g), -(2+g),-(4+2*g),-(3-g), -(2+g),(4+2*g),-(3-g), (2+g),-(4+2*g),-(3-g), (2+g),(4+2*g),-(3-g), -(2+g),-(4+2*g),(3-g), -(2+g),(4+2*g),(3-g), (2+g),-(4+2*g),(3-g), (2+g),(4+2*g),(3-g),

-(2+g),-(-2+4*g),-(1+3*g), -(2+g),-(-2+4*g),(1+3*g), -(2+g),(-2+4*g),-(1+3*g), -(2+g),(-2+4*g),(1+3*g), (2+g),-(-2+4*g),-(1+3*g), (2+g),-(-2+4*g),(1+3*g), (2+g),(-2+4*g),-(1+3*g), (2+g),(-2+4*g),(1+3*g), -(1+3*g),-(2+g),-(-2+4*g), (1+3*g),-(2+g),-(-2+4*g), -(1+3*g),-(2+g),(-2+4*g), (1+3*g),-(2+g),(-2+4*g), -(1+3*g),(2+g),-(-2+4*g), (1+3*g),(2+g),-(-2+4*g), -(1+3*g),(2+g),(-2+4*g), (1+3*g),(2+g),(-2+4*g), -(-2+4*g),-(1+3*g),-(2+g), -(-2+4*g),(1+3*g),-(2+g), (-2+4*g),-(1+3*g),-(2+g), (-2+4*g),(1+3*g),-(2+g), -(-2+4*g),-(1+3*g),(2+g), -(-2+4*g),(1+3*g),(2+g), (-2+4*g),-(1+3*g),(2+g), (-2+4*g),(1+3*g),(2+g) }; int truncdodecat[]={ 10,24,48,53,29,33,57,50,26,6,4, 10,53,38,14,18,42,55,31,11,9,29, 10,39,57,33,9,11,35,59,43,19,15, 10,40,45,21,25,49,42,18,2,0,16, 10,28,52,44,20,4,6,22,46,56,32, 10,5,7,27,51,59,35,31,55,49,25, 10,8,32,56,37,13,17,41,58,34,10, 10,17,1,3,19,43,51,27,23,47,41, 10,47,23,7,5,21,45,54,30,34,58, 10,37,46,22,26,50,39,15,3,1,13, 10,24,20,44,36,12,0,2,14,38,48, 10,36,52,28,8,10,30,54,40,16,12, 3,33,29,9, 3,50,57,39, 3,53,48,38, 3,11,31,35, 3,25,21,5, 3,42,49,55, 3,7,23,27, 3,40,54,45, 3,52,36,44, 3,8,28,32, 3,22,6,26, 3,20,24,4, 3,51,43,59, 3,56,46,37, 3,13,1,17, 3,41,47,58, 3,3,15,19, 3,14,2,18, 3,12,16,0, 3,10,34,30 }; double rhombicuboctav[]={ -(1+s),-1,-1, -(1+s),-1,1, -(1+s),1,-1, -(1+s),1,1, (1+s),-1,-1, (1+s),-1,1, (1+s),1,-1, (1+s),1,1, -1,-(1+s),-1, 1,-(1+s),-1, -1,-(1+s),1, 1,-(1+s),1, -1,(1+s),-1, 1,(1+s),-1, -1,(1+s),1, 1,(1+s),1, -1,-1,-(1+s), -1,1,-(1+s), 1,-1,-(1+s), 1,1,-(1+s), -1,-1,(1+s), -1,1,(1+s), 1,-1,(1+s), 1,1,(1+s) }; int rhombicuboctat[]={ 4,5,7,6,4, 4,5,22,23,7, 4,6,7,15,13, 4,4,6,19,18, 4,9,11,5,4, 4,21,20,1,3, 4,3,1,0,2, 4,2,12,14,3, 4,17,2,0,16, 4,0,1,10,8, 4,10,11,9,8, 4,8,9,18,16, 4,16,18,19,17, 4,11,10,20,22, 4,22,20,21,23, 4,23,21,14,15, 4,12,17,19,13, 4,13,15,14,12, 3,11,22,5, 3,7,23,15, 3,6,13,19, 3,9,4,18, 3,14,21,3, 3,16,0,8, 3,17,12,2, 3,1,20,10 }; double snubhexa1v[]={ -1,-w,1/w, -1,w,-1/w, 1,-w,-1/w, 1,w,1/w, 1/w,-1,-w, -1/w,-1,w, -1/w,1,-w, 1/w,1,w, -w,1/w,-1, w,-1/w,-1, -w,-1/w,1, w,1/w,1,

-1,-1/w,-w, -1,1/w,w, 1,-1/w,w, 1,1/w,-w, -w,-1,-1/w, w,-1,1/w, w,1,-1/w, -w,1,1/w, -1/w,-w,-1, 1/w,w,-1, -1/w,w,1, 1/w,-w,1 }; int snubhexa1t[]={ 4,9,12,10,14, 4,16,2,18,1, 4,3,17,0,19, 4,15,11,13,8, 4,22,5,20,6, 4,23,7,21,4, 3,12,5,10, 3,12,20,5, 3,5,0,10, 3,10,0,17, 3,22,0,5, 3,11,15,7, 3,19,11,3, 3,11,7,3, 3,9,14,4, 3,14,23,4, 3,10,17,14, 3,14,17,23, 3,15,21,7, 3,7,23,3, 3,20,12,16, 3,1,18,8, 3,23,17,3, 3,6,20,1, 3,12,9,16, 3,20,16,1, 3,9,2,16, 3,9,4,2, 3,4,21,2, 3,18,21,15, 3,18,15,8, 3,8,6,1, 3,6,8,13, 3,22,6,13, 3,11,19,13, 3,13,19,22, 3,22,19,0, 3,21,18,2 }; double snubhexa2v[]={ 1,-w,1/w, 1,w,-1/w, -1,-w,-1/w, -1,w,1/w, -1/w,-1,-w, 1/w,-1,w, 1/w,1,-w, -1/w,1,w, w,1/w,-1, -w,-1/w,-1, w,-1/w,1, -w,1/w,1,

1,-1/w,-w, 1,1/w,w, -1,-1/w,w, -1,1/w,-w, w,-1,-1/w, -w,-1,1/w, -w,1,-1/w, w,1,1/w, 1/w,-w,-1, -1/w,w,-1, 1/w,w,1, -1/w,-w,1 }; int snubhexa2t[]={ 4,9,14,10,12, 4,18,2,16,1, 4,3,19,0,17, 4,15,8,13,11, 4,22,6,20,5, 4,23,4,21,7, 3,12,10,5, 3,12,5,20, 3,5,10,0, 3,10,17,0, 3,22,5,0, 3,11,7,15, 3,19,3,11, 3,11,3,7, 3,9,4,14, 3,14,4,23, 3,10,14,17, 3,14,23,17, 3,15,7,21, 3,7,3,23, 3,20,16,12, 3,1,8,18, 3,23,3,17, 3,6,1,20, 3,12,16,9, 3,20,1,16, 3,9,16,2, 3,9,2,4, 3,4,2,21, 3,18,15,21, 3,18,8,15, 3,8,1,6, 3,6,13,8, 3,22,13,6, 3,11,13,19, 3,13,22,19, 3,22,0,19, 3,21,2,18 }; double rhombicosadodecav[]={ -1,-1,-g*q, -1,-1,g*q, -1,1,-g*q, -1,1,g*q, 1,-1,-g*q, 1,-1,g*q, 1,1,-g*q, 1,1,g*q, -g*q,-1,-1, g*q,-1,-1, -g*q,-1,1, g*q,-1,1, -g*q,1,-1, g*q,1,-1, -g*q,1,1, g*q,1,1, -1,-g*q,-1, -1,g*q,-1, 1,-g*q,-1, 1,g*q,-1, -1,-g*q,1, -1,g*q,1, 1,-g*q,1, 1,g*q,1,

-q,-g,-j, -q,-g,j, -q,g,-j, -q,g,j, q,-g,-j, q,-g,j, q,g,-j, q,g,j, -j,-q,-g, j,-q,-g, -j,-q,g, j,-q,g, -j,q,-g, j,q,-g, -j,q,g, j,q,g, -g,-j,-q, -g,j,-q, g,-j,-q, g,j,-q, -g,-j,q, -g,j,q, g,-j,q, g,j,q,

-(2+g),0,-q, -(2+g),0,q, (2+g),0,-q, (2+g),0,q, -q,-(2+g),0, q,-(2+g),0, -q,(2+g),0, q,(2+g),0, 0,-q,-(2+g), 0,q,-(2+g), 0,-q,(2+g), 0,q,(2+g) }; int rhombicosadodecat[]={ 5,44,58,46,22,20, 5,1,25,49,27,3, 5,57,43,19,17,41, 5,21,23,47,59,45, 5,31,51,29,5,7, 5,10,34,52,32,8, 5,48,24,0,2,26, 5,12,36,54,38,14, 5,6,4,28,50,30, 5,15,39,55,37,13, 5,33,53,35,11,9, 5,40,16,18,42,56,

4,34,44,20,52, 4,44,25,1,58, 4,3,27,45,59, 4,5,1,3,7, 4,25,34,10,49, 4,27,49,14,38, 4,20,22,18,16, 4,18,53,33,42, 4,6,30,43,57, 4,2,57,41,26, 4,4,6,2,0, 4,47,31,7,59, 4,55,39,47,23, 4,5,29,46,58, 4,31,39,15,51, 4,52,16,40,32, 4,12,48,26,36, 4,36,41,17,54, 4,38,54,21,45, 4,21,17,19,23, 4,55,19,43,37, 4,30,50,13,37, 4,33,9,50,28, 4,14,10,8,12, 4,9,11,15,13, 4,11,35,29,51, 4,53,22,46,35, 4,56,42,28,4, 4,24,40,56,0, 4,48,8,32,24,

3,34,25,44, 3,58,1,5, 3,27,38,45, 3,52,20,16, 3,22,53,18, 3,2,6,57, 3,3,59,7, 3,19,55,23, 3,47,39,31, 3,29,35,46, 3,14,49,10, 3,41,36,26, 3,54,17,21, 3,37,43,30, 3,0,56,4, 3,9,13,50, 3,33,28,42, 3,12,8,48, 3,11,51,15, 3,24,32,40 }; double trunccuboctav[]={ -1,-(1+s),-(1+s+s), -1,-(1+s),(1+s+s), -1,(1+s),-(1+s+s), -1,(1+s),(1+s+s), 1,-(1+s),-(1+s+s), 1,-(1+s),(1+s+s), 1,(1+s),-(1+s+s), 1,(1+s),(1+s+s), -(1+s+s),-1,-(1+s), (1+s+s),-1,-(1+s), -(1+s+s),-1,(1+s), (1+s+s),-1,(1+s), -(1+s+s),1,-(1+s), (1+s+s),1,-(1+s), -(1+s+s),1,(1+s), (1+s+s),1,(1+s), -(1+s),-(1+s+s),-1, -(1+s),(1+s+s),-1, (1+s),-(1+s+s),-1, (1+s),(1+s+s),-1, -(1+s),-(1+s+s),1, -(1+s),(1+s+s),1, (1+s),-(1+s+s),1, (1+s),(1+s+s),1,

-1,-(1+s+s),-(1+s), -1,-(1+s+s),(1+s), -1,(1+s+s),-(1+s), -1,(1+s+s),(1+s), 1,-(1+s+s),-(1+s), 1,-(1+s+s),(1+s), 1,(1+s+s),-(1+s), 1,(1+s+s),(1+s), -(1+s),-1,-(1+s+s), (1+s),-1,-(1+s+s), -(1+s),-1,(1+s+s), (1+s),-1,(1+s+s), -(1+s),1,-(1+s+s), (1+s),1,-(1+s+s), -(1+s),1,(1+s+s), (1+s),1,(1+s+s), -(1+s+s),-(1+s),-1, -(1+s+s),(1+s),-1, (1+s+s),-(1+s),-1, (1+s+s),(1+s),-1, -(1+s+s),-(1+s),1, -(1+s+s),(1+s),1, (1+s+s),-(1+s),1, (1+s+s),(1+s),1 }; int trunccuboctat[]={ 8,5,1,34,38,3,7,39,35, 8,12,41,45,14,10,44,40,8, 8,37,6,2,36,32,0,4,33, 8,23,31,27,21,17,26,30,19, 8,24,16,20,25,29,22,18,28, 8,43,13,9,42,46,11,15,47,

6,3,38,14,45,21,27, 6,1,25,20,44,10,34, 6,11,46,22,29,5,35, 6,15,39,7,31,23,47, 6,2,26,17,41,12,36, 6,37,13,43,19,30,6, 6,8,40,16,24,0,32, 6,9,33,4,28,18,42,

4,7,3,27,31, 4,38,34,10,14, 4,5,29,25,1, 4,39,15,11,35, 4,36,12,8,32, 4,6,30,26,2, 4,47,23,19,43, 4,40,44,20,16, 4,0,24,28,4, 4,9,13,37,33, 4,41,17,21,45, 4,46,42,18,22 }; double truncicosidodecav[]={ -d,-d,-(3+g), -d,-d,(3+g), -d,d,-(3+g), -d,d,(3+g), d,-d,-(3+g), d,-d,(3+g), d,d,-(3+g), d,d,(3+g), -(3+g),-d,-d, -(3+g),-d,d, -(3+g),d,-d, -(3+g),d,d, (3+g),-d,-d, (3+g),-d,d, (3+g),d,-d, (3+g),d,d, -d,-(3+g),-d, -d,-(3+g),d, -d,(3+g),-d, -d,(3+g),d, d,-(3+g),-d, d,-(3+g),d, d,(3+g),-d, d,(3+g),d,

-2*d,-g,-(g+q), -2*d,-g,(g+q), -2*d,g,-(g+q), -2*d,g,(g+q), 2*d,-g,-(g+q), 2*d,-g,(g+q), 2*d,g,-(g+q), 2*d,g,(g+q), -(g+q),-2*d,-g, -(g+q),-2*d,g, -(g+q),2*d,-g, -(g+q),2*d,g, (g+q),-2*d,-g, (g+q),-2*d,g, (g+q),2*d,-g, (g+q),2*d,g, -g,-(g+q),-2*d, -g,-(g+q),2*d, -g,(g+q),-2*d, -g,(g+q),2*d, g,-(g+q),-2*d, g,-(g+q),2*d, g,(g+q),-2*d, g,(g+q),2*d,

-d,-q,-(j+d), -d,-q,(j+d), -d,q,-(j+d), -d,q,(j+d), d,-q,-(j+d), d,-q,(j+d), d,q,-(j+d), d,q,(j+d), -(j+d),-d,-q, -(j+d),-d,q, -(j+d),d,-q, -(j+d),d,q, (j+d),-d,-q, (j+d),-d,q, (j+d),d,-q, (j+d),d,q, -q,-(j+d),-d, -q,-(j+d),d, -q,(j+d),-d, -q,(j+d),d, q,-(j+d),-d, q,-(j+d),d, q,(j+d),-d, q,(j+d),d,

-(j-1),-2,-(2+g), -(j-1),-2,(2+g), -(j-1),2,-(2+g), -(j-1),2,(2+g), (j-1),-2,-(2+g), (j-1),-2,(2+g), (j-1),2,-(2+g), (j-1),2,(2+g), -(2+g),-(j-1),-2, -(2+g),-(j-1),2, -(2+g),(j-1),-2, -(2+g),(j-1),2, (2+g),-(j-1),-2, (2+g),-(j-1),2, (2+g),(j-1),-2, (2+g),(j-1),2, -2,-(2+g),-(j-1), -2,-(2+g),(j-1), -2,(2+g),-(j-1), -2,(2+g),(j-1), 2,-(2+g),-(j-1), 2,-(2+g),(j-1), 2,(2+g),-(j-1), 2,(2+g),(j-1),

-g,-3,-j, -g,-3,j, -g,3,-j, -g,3,j, g,-3,-j, g,-3,j, g,3,-j, g,3,j, -j,-g,-3, -j,-g,3, -j,g,-3, -j,g,3, j,-g,-3, j,-g,3, j,g,-3, j,g,3, -3,-j,-g, -3,-j,g, -3,j,-g, -3,j,g, 3,-j,-g, 3,-j,g, 3,j,-g, 3,j,g }; int truncicosidodecat[]={ 10,44,92,100,52,48,96,88,40,16,20, 10,68,69,117,85,37,13,12,36,84,116, 10,8,9,33,81,113,65,64,112,80,32, 10,21,17,41,89,97,49,53,101,93,45, 10,10,34,82,114,66,67,115,83,35,11, 10,77,29,5,7,31,79,111,63,61,109, 10,90,98,50,54,102,94,46,22,18,42, 10,51,99,91,43,19,23,47,95,103,55, 10,119,71,70,118,86,38,14,15,39,87, 10,74,106,58,56,104,72,24,0,2,26, 10,57,59,107,75,27,3,1,25,73,105, 10,76,108,60,62,110,78,30,6,4,28,

6,44,20,21,45,69,68, 6,63,39,15,13,37,61, 6,12,14,38,62,60,36, 6,80,112,88,96,72,104, 6,16,40,64,65,41,17, 6,34,10,8,32,56,58, 6,9,11,35,59,57,33, 6,114,82,106,74,98,90, 6,101,77,109,85,117,93, 6,116,84,108,76,100,92, 6,75,107,83,115,91,99, 6,7,3,27,51,55,31, 6,43,67,66,42,18,19, 6,23,22,46,70,71,47, 6,103,95,119,87,111,79, 6,118,94,102,78,110,86, 6,50,26,2,6,30,54, 6,0,24,48,52,28,4, 6,1,5,29,53,49,25, 6,113,81,105,73,97,89,

4,20,16,17,21, 4,92,44,68,116, 4,109,61,37,85, 4,69,45,93,117, 4,41,65,113,89, 4,56,32,80,104, 4,10,11,9,8, 4,82,34,58,106, 4,101,53,29,77, 4,42,66,114,90, 4,40,88,112,64, 4,27,75,99,51, 4,107,59,35,83, 4,91,115,67,43, 4,55,103,79,31, 4,47,71,119,95, 4,19,18,22,23, 4,46,94,118,70, 4,14,12,13,15, 4,87,39,63,111, 4,60,108,84,36, 4,110,62,38,86, 4,98,74,26,50, 4,2,0,4,6, 4,1,3,7,5, 4,73,25,49,97, 4,96,48,24,72, 4,100,76,28,52, 4,81,33,57,105, 4,102,54,30,78 }; double snubdodeca1v[]={ -2*aa,-2,2*bb, -2*aa,2,-2*bb, 2*aa,-2,-2*bb, 2*aa,2,2*bb, 2*bb,-2*aa,-2, -2*bb,-2*aa,2, -2*bb,2*aa,-2, 2*bb,2*aa,2, -2,2*bb,-2*aa, 2,-2*bb,-2*aa, -2,-2*bb,2*aa, 2,2*bb,2*aa,

-(aa+bb*d+g),-(-aa*g+bb+d),(aa*d+bb*g-1), -(aa+bb*d+g),(-aa*g+bb+d),-(aa*d+bb*g-1), (aa+bb*d+g),-(-aa*g+bb+d),-(aa*d+bb*g-1), (aa+bb*d+g),(-aa*g+bb+d),(aa*d+bb*g-1), (aa*d+bb*g-1),-(aa+bb*d+g),-(-aa*g+bb+d), -(aa*d+bb*g-1),-(aa+bb*d+g),(-aa*g+bb+d), -(aa*d+bb*g-1),(aa+bb*d+g),-(-aa*g+bb+d), (aa*d+bb*g-1),(aa+bb*d+g),(-aa*g+bb+d), -(-aa*g+bb+d),(aa*d+bb*g-1),-(aa+bb*d+g), (-aa*g+bb+d),-(aa*d+bb*g-1),-(aa+bb*d+g), -(-aa*g+bb+d),-(aa*d+bb*g-1),(aa+bb*d+g), (-aa*g+bb+d),(aa*d+bb*g-1),(aa+bb*d+g),

-(-aa*d+bb*g+1),-(-aa+bb*d-g),(aa*g+bb-d), -(-aa*d+bb*g+1),(-aa+bb*d-g),-(aa*g+bb-d), (-aa*d+bb*g+1),-(-aa+bb*d-g),-(aa*g+bb-d), (-aa*d+bb*g+1),(-aa+bb*d-g),(aa*g+bb-d), (aa*g+bb-d),-(-aa*d+bb*g+1),-(-aa+bb*d-g), -(aa*g+bb-d),-(-aa*d+bb*g+1),(-aa+bb*d-g), -(aa*g+bb-d),(-aa*d+bb*g+1),-(-aa+bb*d-g), (aa*g+bb-d),(-aa*d+bb*g+1),(-aa+bb*d-g), -(-aa+bb*d-g),(aa*g+bb-d),-(-aa*d+bb*g+1), (-aa+bb*d-g),-(aa*g+bb-d),-(-aa*d+bb*g+1), -(-aa+bb*d-g),-(aa*g+bb-d),(-aa*d+bb*g+1), (-aa+bb*d-g),(aa*g+bb-d),(-aa*d+bb*g+1),

-(-aa*d+bb*g-1),-(aa-bb*d-g),(aa*g+bb+d), -(-aa*d+bb*g-1),(aa-bb*d-g),-(aa*g+bb+d), (-aa*d+bb*g-1),-(aa-bb*d-g),-(aa*g+bb+d), (-aa*d+bb*g-1),(aa-bb*d-g),(aa*g+bb+d), (aa*g+bb+d),-(-aa*d+bb*g-1),-(aa-bb*d-g), -(aa*g+bb+d),-(-aa*d+bb*g-1),(aa-bb*d-g), -(aa*g+bb+d),(-aa*d+bb*g-1),-(aa-bb*d-g), (aa*g+bb+d),(-aa*d+bb*g-1),(aa-bb*d-g), -(aa-bb*d-g),(aa*g+bb+d),-(-aa*d+bb*g-1), (aa-bb*d-g),-(aa*g+bb+d),-(-aa*d+bb*g-1), -(aa-bb*d-g),-(aa*g+bb+d),(-aa*d+bb*g-1), (aa-bb*d-g),(aa*g+bb+d),(-aa*d+bb*g-1),

-(aa+bb*d-g),-(aa*g-bb+d),(aa*d+bb*g+1), -(aa+bb*d-g),(aa*g-bb+d),-(aa*d+bb*g+1), (aa+bb*d-g),-(aa*g-bb+d),-(aa*d+bb*g+1), (aa+bb*d-g),(aa*g-bb+d),(aa*d+bb*g+1), (aa*d+bb*g+1),-(aa+bb*d-g),-(aa*g-bb+d), -(aa*d+bb*g+1),-(aa+bb*d-g),(aa*g-bb+d), -(aa*d+bb*g+1),(aa+bb*d-g),-(aa*g-bb+d), (aa*d+bb*g+1),(aa+bb*d-g),(aa*g-bb+d), -(aa*g-bb+d),(aa*d+bb*g+1),-(aa+bb*d-g), (aa*g-bb+d),-(aa*d+bb*g+1),-(aa+bb*d-g), -(aa*g-bb+d),-(aa*d+bb*g+1),(aa+bb*d-g), (aa*g-bb+d),(aa*d+bb*g+1),(aa+bb*d-g), }; int snubdodeca1t[]={ 5,7,19,31,43,55, 5,15,27,39,51,3, 5,52,4,16,28,40, 5,46,58,10,22,34, 5,9,21,33,45,57, 5,5,17,29,41,53, 5,2,14,26,38,50, 5,6,18,30,42,54, 5,47,59,11,23,35, 5,8,20,32,44,56, 5,12,24,36,48,0, 5,1,13,25,37,49,

3,7,27,19, 3,19,27,15, 3,7,52,27, 3,52,39,27, 3,4,52,7,    3,31,19,23, 3,40,39,52, 3,58,46,40, 3,58,40,28, 3,9,58,28, 3,9,28,21, 3,21,28,16, 3,21,16,14, 3,14,16,26, 3,26,16,4,   3,46,39,40, 3,51,39,46, 3,34,51,46, 3,51,0,3, 3,58,9,10, 3,12,34,22, 3,12,22,17, 3,24,12,17, 3,5,24,17, 3,54,24,5,   3,6,54,5, 3,17,22,29, 3,22,10,29, 3,33,21,14, 3,2,33,14, 3,49,33,2, 3,1,2,50, 3,1,50,32, 3,5,53,6, 3,24,54,36,       3,36,54,42, 3,36,42,47, 3,47,42,59, 3,42,30,59, 3,59,30,8, 3,8,30,20, 3,20,30,18, 3,20,18,13, 3,13,18,25, 3,32,13,1,   3,2,1,49, 3,44,32,50, 3,4,7,55, 3,26,4,55, 3,38,26,55, 3,38,55,43, 3,38,44,50, 3,32,20,13, 3,38,43,44, 3,44,43,56, 3,56,43,31, 3,8,11,59, 3,11,8,56, 3,11,56,31, 3,11,31,23, 3,23,19,15, 3,23,15,35, 3,35,15,3, 3,35,3,48, 3,48,3,0,     3,47,35,48, 3,47,48,36, 3,0,34,12, 3,0,51,34, 3,10,9,57, 3,10,57,29, 3,29,57,41, 3,41,57,45, 3,41,37,53, 3,49,45,33, 3,45,37,41, 3,37,25,53, 3,25,18,6, 3,25,6,53, 3,49,37,45 };  double snubdodeca2v[]={ 2*aa,-2,2*bb, 2*aa,2,-2*bb, -2*aa,-2,-2*bb, -2*aa,2,2*bb, -2*bb,-2*aa,-2, 2*bb,-2*aa,2, 2*bb,2*aa,-2, -2*bb,2*aa,2, 2,2*bb,-2*aa, -2,-2*bb,-2*aa, 2,-2*bb,2*aa, -2,2*bb,2*aa,

(aa+bb*d+g),-(-aa*g+bb+d),(aa*d+bb*g-1), (aa+bb*d+g),(-aa*g+bb+d),-(aa*d+bb*g-1), -(aa+bb*d+g),-(-aa*g+bb+d),-(aa*d+bb*g-1), -(aa+bb*d+g),(-aa*g+bb+d),(aa*d+bb*g-1), -(aa*d+bb*g-1),-(aa+bb*d+g),-(-aa*g+bb+d), (aa*d+bb*g-1),-(aa+bb*d+g),(-aa*g+bb+d), (aa*d+bb*g-1),(aa+bb*d+g),-(-aa*g+bb+d), -(aa*d+bb*g-1),(aa+bb*d+g),(-aa*g+bb+d), (-aa*g+bb+d),(aa*d+bb*g-1),-(aa+bb*d+g), -(-aa*g+bb+d),-(aa*d+bb*g-1),-(aa+bb*d+g), (-aa*g+bb+d),-(aa*d+bb*g-1),(aa+bb*d+g), -(-aa*g+bb+d),(aa*d+bb*g-1),(aa+bb*d+g),

(-aa*d+bb*g+1),-(-aa+bb*d-g),(aa*g+bb-d), (-aa*d+bb*g+1),(-aa+bb*d-g),-(aa*g+bb-d), -(-aa*d+bb*g+1),-(-aa+bb*d-g),-(aa*g+bb-d), -(-aa*d+bb*g+1),(-aa+bb*d-g),(aa*g+bb-d), -(aa*g+bb-d),-(-aa*d+bb*g+1),-(-aa+bb*d-g), (aa*g+bb-d),-(-aa*d+bb*g+1),(-aa+bb*d-g), (aa*g+bb-d),(-aa*d+bb*g+1),-(-aa+bb*d-g), -(aa*g+bb-d),(-aa*d+bb*g+1),(-aa+bb*d-g), (-aa+bb*d-g),(aa*g+bb-d),-(-aa*d+bb*g+1), -(-aa+bb*d-g),-(aa*g+bb-d),-(-aa*d+bb*g+1), (-aa+bb*d-g),-(aa*g+bb-d),(-aa*d+bb*g+1), -(-aa+bb*d-g),(aa*g+bb-d),(-aa*d+bb*g+1),

(-aa*d+bb*g-1),-(aa-bb*d-g),(aa*g+bb+d), (-aa*d+bb*g-1),(aa-bb*d-g),-(aa*g+bb+d), -(-aa*d+bb*g-1),-(aa-bb*d-g),-(aa*g+bb+d), -(-aa*d+bb*g-1),(aa-bb*d-g),(aa*g+bb+d), -(aa*g+bb+d),-(-aa*d+bb*g-1),-(aa-bb*d-g), (aa*g+bb+d),-(-aa*d+bb*g-1),(aa-bb*d-g), (aa*g+bb+d),(-aa*d+bb*g-1),-(aa-bb*d-g), -(aa*g+bb+d),(-aa*d+bb*g-1),(aa-bb*d-g), (aa-bb*d-g),(aa*g+bb+d),-(-aa*d+bb*g-1), -(aa-bb*d-g),-(aa*g+bb+d),-(-aa*d+bb*g-1), (aa-bb*d-g),-(aa*g+bb+d),(-aa*d+bb*g-1), -(aa-bb*d-g),(aa*g+bb+d),(-aa*d+bb*g-1),

(aa+bb*d-g),-(aa*g-bb+d),(aa*d+bb*g+1), (aa+bb*d-g),(aa*g-bb+d),-(aa*d+bb*g+1), -(aa+bb*d-g),-(aa*g-bb+d),-(aa*d+bb*g+1), -(aa+bb*d-g),(aa*g-bb+d),(aa*d+bb*g+1), -(aa*d+bb*g+1),-(aa+bb*d-g),-(aa*g-bb+d), (aa*d+bb*g+1),-(aa+bb*d-g),(aa*g-bb+d), (aa*d+bb*g+1),(aa+bb*d-g),-(aa*g-bb+d), -(aa*d+bb*g+1),(aa+bb*d-g),(aa*g-bb+d), (aa*g-bb+d),(aa*d+bb*g+1),-(aa+bb*d-g), -(aa*g-bb+d),-(aa*d+bb*g+1),-(aa+bb*d-g), (aa*g-bb+d),-(aa*d+bb*g+1),(aa+bb*d-g), -(aa*g-bb+d),(aa*d+bb*g+1),(aa+bb*d-g), }; int snubdodeca2t[]={ 5,7,55,43,31,19, 5,15,3,51,39,27, 5,52,40,28,16,4, 5,46,34,22,10,58, 5,9,57,45,33,21, 5,5,53,41,29,17, 5,2,50,38,26,14, 5,6,54,42,30,18, 5,47,35,23,11,59, 5,8,56,44,32,20, 5,12,0,48,36,24, 5,1,49,37,25,13,

3,7,19,27, 3,19,15,27, 3,7,27,52, 3,52,27,39, 3,4,7,52,    3,31,23,19, 3,40,52,39, 3,58,40,46, 3,58,28,40, 3,9,28,58, 3,9,21,28, 3,21,16,28, 3,21,14,16, 3,14,26,16, 3,26,4,16,   3,46,40,39, 3,51,46,39, 3,34,46,51, 3,51,3,0, 3,58,10,9, 3,12,22,34, 3,12,17,22, 3,24,17,12, 3,5,17,24, 3,54,5,24,   3,6,5,54, 3,17,29,22, 3,22,29,10, 3,33,14,21, 3,2,14,33, 3,49,2,33, 3,1,50,2, 3,1,32,50, 3,5,6,53, 3,24,36,54,       3,36,42,54, 3,36,47,42, 3,47,59,42, 3,42,59,30, 3,59,8,30, 3,8,20,30, 3,20,18,30, 3,20,13,18, 3,13,25,18, 3,32,1,13,   3,2,49,1, 3,44,50,32, 3,4,55,7, 3,26,55,4, 3,38,55,26, 3,38,43,55, 3,38,50,44, 3,32,13,20, 3,38,44,43, 3,44,56,43, 3,56,31,43, 3,8,59,11, 3,11,56,8, 3,11,31,56, 3,11,23,31, 3,23,15,19, 3,23,35,15, 3,35,3,15, 3,35,48,3, 3,48,0,3,     3,47,48,35, 3,47,36,48, 3,0,12,34, 3,0,34,51, 3,10,57,9, 3,10,29,57, 3,29,41,57, 3,41,45,57, 3,41,53,37, 3,49,33,45, 3,45,41,37, 3,37,53,25, 3,25,6,18, 3,25,53,6, 3,49,45,37 };

/*-!,-@,#, -!,@,-#, !,-@,-#, !,@,#, -@,#,-!, @,-#,-!, -@,-#,!, @,#,!,

!,-@,#, !,@,-#, -!,-@,-#, -!,@,#, -#,-!,-@, #,-!,@, #,!,-@, -#,!,@, @,#,-!, -@,-#,-!, @,-#,!, -@,#,!,*/

boolean DEBUG=/*/true;/*/false;/**/

public void paint(Graphics g) { g.setColor(new Color(0xffffff)); g.fillRect(0, 0, 200, 200); double n=Math.random; /*  if(n<.2) drawfig(g, tetrav, tetrat, 3); else if(n<.4) drawfig(g, hexav, hexat, 4); else if(n<.6) drawfig(g, octav, octat, 3); else if(n<.8) drawfig(g, dodecav, dodecat, 5); else drawfig(g, icosav, icosat, 3); */   //drawfig(g, tetrav, tetrat, 3); //drawfig(g, hexav, hexat, 4); //drawfig(g, octav, octat, 3); //drawfig(g, dodecav, dodecat, 5); //drawfig(g, icosav, icosat, 3); //drawfig(g, icosidodecav, icosidodecat, -1); //drawfig(g, cuboctav, cuboctat, -1); //drawfig(g, truncicosav, truncicosat, -1); //drawfig(g, trunctetrav, trunctetrat, -1); //drawfig(g, trunchexav, trunchexat, -1); //drawfig(g, truncoctav, truncoctat, -1); //drawfig(g, truncdodecav, truncdodecat, -1); //drawfig(g, rhombicuboctav, rhombicuboctat, -1); //drawfig(g, snubhexa1v, snubhexa1t, -1); //drawfig(g, snubhexa2v, snubhexa2t, -1); //drawfig(g, rhombicosadodecav, rhombicosadodecat, -1); //drawfig(g, trunccuboctav, trunccuboctat, -1); //drawfig(g, truncicosidodecav, truncicosidodecat, -1); //drawfig(g, snubdodeca1v, snubdodeca1t, -1); drawfig(g, snubdodeca2v, snubdodeca2t, -1); } void drawfig(Graphics g, double vs[], int ts[], int m) { int z=m, y=m; if(m==-1) m=1; double tr[]=randmat; for(int back=(DEBUG?1:-1);back<=1;back+=2) for(int t=0;t*m<ts.length;++t) { if(z==-1) { y=(int)ts[t]; ++t; } double f, td[]; double a1=vs[ts[t*m ]*3], a2=vs[ts[t*m  ]*3+1], a3=vs[ts[t*m  ]*3+2]; f=1/Math.sqrt(a1*a1+a2*a2+a3*a3); a1*=f; a2*=f; a3*=f; td=trans(a1, a2, a3, tr); a1=td[0]; a2=td[1]; a3=td[2]; double b1=vs[ts[t*m+1]*3], b2=vs[ts[t*m+1]*3+1], b3=vs[ts[t*m+1]*3+2]; f=1/Math.sqrt(b1*b1+b2*b2+b3*b3); b1*=f; b2*=f; b3*=f; td=trans(b1, b2, b3, tr); b1=td[0]; b2=td[1]; b3=td[2]; double c1=vs[ts[t*m+2]*3], c2=vs[ts[t*m+2]*3+1], c3=vs[ts[t*m+2]*3+2]; f=1/Math.sqrt(c1*c1+c2*c2+c3*c3); c1*=f; c2*=f; c3*=f; td=trans(c1, c2, c3, tr); c1=td[0]; c2=td[1]; c3=td[2]; double d1=b1-a1, d2=b2-a2, d3=b3-a3; double e1=c1-a1, e2=c2-a2, e3=c3-a3; double f1=e2*d3-d2*e3, f2=e3*d1-d3*e1, f3=e1*d2-d1*e2; double da1=a1/(4+a3), da2=a2/(4+a3), db1=b1/(4+b3)-da1, db2=b2/(4+b3)-da2, dc1=c1/(4+c3)-da1, dc2=c2/(4+c3)-da2; if(back*(db1*dc2-dc1*db2)/*f3*/>0) { g.setColor(new Color((float)Math.random, (float)Math.random, (float)Math.random, (float)(/*.85+.15*/ .75+.25*Math.random)/*(float)(back<0?.90:0.90)*/)); int xa[]=new int[y], ya[]=new int[y]; xa[0]=(int)(a1*3/(4+a3)*100+100); xa[1]=(int)(b1*3/(4+b3)*100+100); xa[2]=(int)(c1*3/(4+c3)*100+100); ya[0]=(int)(a2*3/(4+a3)*100+100); ya[1]=(int)(b2*3/(4+b3)*100+100); ya[2]=(int)(c2*3/(4+c3)*100+100); for(int w=0/*3*/;w<y;++w) { a1=vs[ts[t*m+w]*3]; a2=vs[ts[t*m+w]*3+1]; a3=vs[ts[t*m+w]*3+2]; f=1/Math.sqrt(a1*a1+a2*a2+a3*a3); a1*=f; a2*=f; a3*=f; td=trans(a1, a2, a3, tr); a1=td[0]; a2=td[1]; a3=td[2]; xa[w]=(int)(a1*3/(4+a3)*100+100); ya[w]=(int)(a2*3/(4+a3)*100+100); }       g.fillPolygon(xa, ya, y); }if(z==-1) t+=y-1; }if(!DEBUG)return; g.setColor(new Color(0, 0, 0)); //g.drawString("Hello", 10, 10); for(int num=0;num<vs.length/3;++num) { double a1=vs[num*3], a2=vs[num*3+1], a3=vs[num*3+2]; double f, td[]; f=1/Math.sqrt(a1*a1+a2*a2+a3*a3); a1*=f; a2*=f; a3*=f; td=trans(a1, a2, a3, tr); a1=td[0]; a2=td[1]; a3=td[2]; //double da1=a1/(4+a3), da2=a2/(4+a3); if(a3<0){//1* db1*dc2-dc1*db2 /*f3*/<0) {       /*a3=0;*/ g.drawString(""+num, (int)(a1*3/(4+a3)*100+100), (int)(a2*3/(4+a3)*100+100));        g.fillRect((int)(a1*3/(4+a3)*100+100)-1, (int)(a2*3/(4+a3)*100+100)-1, 3, 3);      }    }  }  double[] randmat {    double[] r=new double[9];    double s, x, y, z;    int i, j;    for(i=0;i<3;++i) {      x=Math.random*2-1;      y=Math.random*2-1;      z=Math.random*2-1;      s=x*x+y*y+z*z;      if(s>1) { --i; continue; }      for(j=0;j<i;++j) {        s=x*r[j*3  ]         +y*r[j*3+1]         +z*r[j*3+2];        x-=s*r[j*3  ];        y-=s*r[j*3+1];        z-=s*r[j*3+2];      }      s=x*x+y*y+z*z;      if(s==0) { --i; continue; }      s=Math.sqrt(s);      x/=s; y/=s; z/=s;      r[i*3  ]=x;      r[i*3+1]=y;      r[i*3+2]=z;    }    if(r[0]*r[4]*r[8]+r[1]*r[5]*r[6]+r[2]*r[3]*r[7]-r[0]*r[5]*r[7]-r[1]*r[3]*r[8]-r[2]*r[4]*r[6]<0) {      r[0]=-r[0]; r[1]=-r[1]; r[2]=-r[2]; }   return(r); } double[] trans(double x, double y, double z, double[] t) { return(new double[]{x*t[0]+y*t[1]+z*t[2],                       x*t[3]+y*t[4]+z*t[5],                        x*t[6]+y*t[7]+z*t[8]}); } } =Graph.html= '''If I use this again, I'll probably convert it to c, first. Probably easier than trying to remember how to compile java, anyway.''' Graph   =Graph.java= import java.awt.*; import java.applet.*; public class Graph extends Applet { double minx=-10, miny=-10, maxx=10, maxy=10, stex=1, stey=1; double addx, addy, scax, scay, delx, dely; int sx, sy; float cr, cg, cb; float gr[]; void drawfunction(function fx, function fy, double st, double en) { double x, y, dx, dy, tx, ty, a, s;   for(a=st;a<=en;) { drawdot(xinpd(tx=fx.y(a)), yinpd(ty=fy.y(a))); x=fx.dydx(a)*scax; y=fy.dydx(a)*scay; s=Math.sqrt(x*x+y*y); do { dx=tx-fx.y(a+.1/s); dy=ty-fy.y(a+.1/s); if(dx*dx*scax*scax+dy*dy*scay*scay<.127201965) break; s*=2; } while(true); a+=.1/s; } }  void drawfunction(function f) { double x, y, s;   for(x=minx;xmaxy-dely*1||y1000) s=1000; x+=.1/scax/s; } }  void drawgrid { double z;   for(z= stey;z<=maxy;z+=stey) drawhorz(yinp(z)); for(z=-stey;z>=miny;z-=stey) drawhorz(yinp(z)); for(z= stex;z<=maxx;z+=stex) drawvert(xinp(z)); for(z=-stex;z>=minx;z-=stex) drawvert(xinp(z)); } void drawaxes { drawhorz(yinp(0)); drawvert(xinp(0)); } void drawhorz(int y) { int x;   for(x=0;x<sx;++x) { subp(x, y-1, cr/2, cg/2, cb/2); subp(x, y, cr  , cg  , cb  ); subp(x, y+1, cr/2, cg/2, cb/2); } }  void drawvert(int x) { int y;   for(y=0;y<sy;++y) { subp(x-1, y, cr/2, cg/2, cb/2); subp(x, y, cr  , cg  , cb  ); subp(x+1, y, cr/2, cg/2, cb/2); } }  void drawdot(double x, double y) { if(x!=x||y!=y) return; int ix=(int)x, iy=(int)y; float ox=(float)(1+ix-x), oy=(float)(1+iy-y); float px=1-ox, py=1-oy; subp(ix-1, iy-1, cr*ox*oy*.05f, cg*ox*oy*.05f, cb*ox*oy*.05f); subp(ix, iy-1, cr   *oy*.05f, cg   *oy*.05f, cb   *oy*.05f); subp(ix+1, iy-1, cr*px*oy*.05f, cg*px*oy*.05f, cb*px*oy*.05f); subp(ix-1, iy, cr*ox   *.05f, cg*ox   *.05f, cb*ox   *.05f); subp(ix, iy  , cr      *.05f, cg      *.05f, cb      *.05f); subp(ix+1, iy, cr*px   *.05f, cg*px   *.05f, cb*px   *.05f); subp(ix-1, iy+1, cr*ox*py*.05f, cg*ox*py*.05f, cb*ox*py*.05f); subp(ix, iy+1, cr   *py*.05f, cg   *py*.05f, cb   *py*.05f); subp(ix+1, iy+1, cr*px*py*.05f, cg*px*py*.05f, cb*px*py*.05f); } int xinp(double x) { return((int)((x+addx)*scax)); } int yinp(double y) { return((int)((y+addy)*scay)); } double xinpd(double x) { return(((x+addx)*scax)); } double yinpd(double y) { return(((y+addy)*scay)); } void subp(int x, int y, float r, float g, float b) { if(x<0||y<0||x>=sx||y>=sy) return; setp(x, y, getpr(x, y)-r, getpg(x, y)-g, getpb(x, y)-b); } void fixp(int x, int y) { if(x<0||y<0||x>=sx||y>=sy) return; float r=getpr(x, y), g=getpg(x, y), b=getpb(x, y); if(r<=0) r=0; else if(r>=1) r=1; if(g<=0) g=0; else if(g>=1) g=1; if(b<=0) b=0; else if(b>=1) b=1; setp(x, y, r, g, b); } void setp(int x, int y, float r, float g, float b) { if(x<0||y<0||x>=sx||y>=sy) return; gr[(x+y*sx)*3]=r; gr[(x+y*sx)*3+1]=g; gr[(x+y*sx)*3+2]=b; } float getpr(int x, int y) { return(gr[(x+y*sx)*3]); } float getpg(int x, int y) { return(gr[(x+y*sx)*3+1]); } float getpb(int x, int y) { return(gr[(x+y*sx)*3+2]); } void setc(float r, float g, float b) { cr=r; cg=g; cb=b; } void cals { delx=maxx-minx; dely=miny-maxy; scax=(sx-1)/delx; scay=(sy-1)/dely; addx=-minx+.5/scax; addy=-maxy+.5/scay; } public void init { int x, y;   sx=getSize.width; sy=getSize.height; gr=new float[sx*sy*3]; cals; for(y=0;y<sy;++y) for(x=0;x<sx;++x) setp(x, y, 1, 1, 1);

minx=-10/3.; miny=-10/3.; maxx=10/3.; maxy=10/3.; stex=1; stey=1; cals; setc(.6f, .6f, .6f); drawfunction(new erf(1)); setc(.1f, .8f, .8f); drawfunction(new erf(2)); setc(.8f, .1f, .8f); drawfunction(new erf(3)); setc(.8f, .8f, .1f); drawfunction(new erf(4)); setc(.1f, .1f, .8f); drawfunction(new erf(5)); /*   setc(.8f, .1f, .1f); drawfunction(new expinvsqlau(5)); setc(.1f, .8f, .1f); drawfunction(new expinvsqlau(6)); setc(.1f, .1f, .1f); drawfunction(new expinvsqlau(7)); setc(.6f, .1f, .81f); drawfunction(new expinvsqlau(50));*/ /*   minx=-1.25; miny=-1.25; maxx=1.25; maxy=1.25; stex=.1; stey=.1; cals; setc(.025f, .025f, .025f); drawgrid; stex=1; stey=1; setc(.3f, .6f, .8f); drawfunction(new fresC, new fresS, -2, 2);

minx=-50; miny=-1.25; maxx=5; maxy=1.25; stex=1; stey=1; cals; setc(.1f, .8f, .8f); drawfunction(new fresS); setc(.8f, .1f, .8f); drawfunction(new fresC);

minx=-1.5; miny=-2.5; maxx=3.5; maxy=2.5; stex=1; stey=1; cals; setc(.3f, .6f, .8f); drawfunction(new paray(new arecip(2)), new parax(new arecip(2)), .05, 50);

minx=-2.5; miny=-1.5; maxx=2.5; maxy=3.5; stex=1; stey=1; cals; setc(.6f, .6f, .6f); drawfunction(new expinvsq); setc(.1f, .8f, .8f); drawfunction(new expinvsqlau(1)); setc(.8f, .1f, .8f); drawfunction(new expinvsqlau(2)); setc(.8f, .8f, .1f); drawfunction(new expinvsqlau(3)); setc(.1f, .1f, .8f); drawfunction(new expinvsqlau(4)); setc(.8f, .1f, .1f); drawfunction(new expinvsqlau(5)); setc(.1f, .8f, .1f); drawfunction(new expinvsqlau(6)); setc(.1f, .1f, .1f); drawfunction(new expinvsqlau(7)); setc(.6f, .1f, .81f); drawfunction(new expinvsqlau(50));

double ax=0, ay=0;//double ax=new multisin.y(123), ay=new multicos.y(123); minx=ax-5/3.; miny=ay-5/3.; maxx=ax+5/3.; maxy=ay+5/3.; stex=.1; stey=.1; cals; setc(.025f, .025f, .025f); drawgrid; stex=1; stey=1; setc(.3f, .6f, .8f); drawfunction(new multisin, new multicos, -3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825, 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825);

minx=-10; miny=-10; maxx=10; maxy=10; stex=1; stey=1; cals; setc(.6f, .6f, .6f); drawfunction(new sin); setc(.1f, .8f, .8f); drawfunction(new sintay(1)); setc(.8f, .1f, .8f); drawfunction(new sintay(2)); setc(.8f, .8f, .1f); drawfunction(new sintay(3)); setc(.1f, .1f, .8f); drawfunction(new sintay(4)); setc(.8f, .1f, .1f); drawfunction(new sintay(5)); setc(.1f, .8f, .1f); drawfunction(new sintay(6)); setc(.1f, .1f, .1f); drawfunction(new sintay(7));

minx=-2.5; miny=-.5; maxx=2.5; maxy=4.5; stex=1; stey=1; cals; setc(.3f, .6f, .8f); drawfunction(new expinvsq);

minx=-2.5; miny=-.5; maxx=2.5; maxy=4.5; stex=1; stey=1; cals; setc(.3f, .6f, .8f); drawfunction(new expinv);

minx=-1; miny=-7; maxx=9; maxy=3; stex=1; stey=1; cals; setc(.3f, .6f, .8f); drawfunction(new ln);

minx=-5; miny=-1; maxx=5; maxy=9; stex=1; stey=1; cals; setc(.3f, .6f, .8f); drawfunction(new exp);

minx=-5; miny=-5; maxx=5; maxy=5; stex=1; stey=1; cals; setc(.1f, .8f, .8f); drawfunction(new sinh); setc(.8f, .1f, .8f); drawfunction(new cosh); setc(.8f, .8f, .1f); drawfunction(new tanh);

minx=-5; miny=-5; maxx=5; maxy=5; stex=1; stey=1; cals; setc(.1f, .8f, .8f); drawfunction(new csch); setc(.8f, .1f, .8f); drawfunction(new sech); setc(.8f, .8f, .1f); drawfunction(new coth);

setc(.8f, .8f, .8f); drawaxes; setc(.1f, .1f, .1f); drawgrid; for(y=0;y<sy;++y) for(x=0;x<sx;++x) fixp(x, y); } public void paint(Graphics g) { int x, y;   for(y=0;y<sy;++y) for(x=0;x<sx;++x) { g.setColor(new Color(gr[(x+y*sx)*3], gr[(x+y*sx)*3+1], gr[(x+y*sx)*3+2])); g.fillRect(x, y, 1, 1); } } }

abstract class function { abstract double y(double x); abstract double dydx(double x); }

class sinh extends function { double y(double x) { return((Math.exp(x)-Math.exp(-x))/2); } double dydx(double x) { return((Math.exp(x)+Math.exp(-x))/2); } }

class cosh extends function { double y(double x) { return((Math.exp(x)+Math.exp(-x))/2); } double dydx(double x) { return((Math.exp(x)-Math.exp(-x))/2); } }

class tanh extends function { double y(double x) { return((Math.exp(x)-Math.exp(-x))/(Math.exp(x)+Math.exp(-x))); } double dydx(double x) { return(1-y(x)*y(x)); } }

class csch extends function { double y(double x) { return(1/((Math.exp(x)-Math.exp(-x))/2)); } double dydx(double x) { return(-((Math.exp(x)+Math.exp(-x))/2)*y(x)*y(x)); } }

class sech extends function { double y(double x) { return(1/((Math.exp(x)+Math.exp(-x))/2)); } double dydx(double x) { return(-((Math.exp(x)-Math.exp(-x))/2)*y(x)*y(x)); } }

class coth extends function { double y(double x) { return(1/((Math.exp(x)-Math.exp(-x))/(Math.exp(x)+Math.exp(-x)))); } double dydx(double x) { return(1-y(x)*y(x)); } }

class exp extends function { double y(double x) { return(Math.exp(x)); } double dydx(double x) { return(Math.exp(x)); } }

class ln extends function { double y(double x) { return(Math.log(x)); } double dydx(double x) { return(1/x); } }

class expinv extends function { double y(double x) { return(Math.exp(-1/x)); } double dydx(double x) { return(Math.exp(-1/x)/x/x); } }

class expinvsq extends function { double y(double x) { return(Math.exp(-1/x/x)); } double dydx(double x) { return(2*Math.exp(-1/x/x)/x/x/x); } }

class sin extends function { double y(double x) { return(Math.sin(x)); } double dydx(double x) { return(Math.cos(x)); } }

class sintay extends function { int n; sintay(int nn) { n=nn; } double y(double x) { double f=1, r=0, t;   int j, k=1, i;    for(j=0;j<n;++j) { for(i=0,t=1;i<k;++i) t*=x; r+=t*f; ++k; f/=k; ++k; f/=-k; }   return(r); } double dydx(double x) { double f=1, r=0, t;   int j, k=1, i;    for(j=0;j<n;++j) { for(i=0,t=1;i<k-1;++i) t*=x; r+=t*f*k; ++k; f/=k; ++k; f/=-k; }   return(r); } }

/* class multisin extends function { double y(double x) { double r=0, f=1; int p=2; for(p<100;++p) if(isp(p)) { r+=Math.sin(x*p)*p*f; f/=-1.1; }   return(r); } boolean isp(int p) { for(int x=2;x<p;++x) if(p/x*x==p) return(false); return(true); } double dydx(double x) { double r=0, f=1; int p=2; for(p<100;++p) if(isp(p)) { r+=Math.cos(x*p)*p*p*f; f/=-1.1; }   return(r); } }

class multicos extends function { double y(double x) { double r=0, f=1; int p=2; for(p<100;++p) if(isp(p)) { r+=Math.cos(x*p)*p*f; f/=-1.1; }   return(r); } boolean isp(int p) { for(int x=2;x<p;++x) if(p/x*x==p) return(false); return(true); } double dydx(double x) { double r=0, f=1; int p=2; for(p<100;++p) if(isp(p)) { r-=Math.sin(x*p)*p*p*f; f/=-1.1; }   return(r); } }

class multisin extends function { double y(double x) { double r=0, f=1; int p=1, q=-1; for(p<100000;q-=(p-=q)) { r+=Math.sin(x*p)/q; f/=-2; }   return(r); } double dydx(double x) { double r=0, f=1; int p=1, q=-1; for(p<100000;q-=(p-=q)) { r+=Math.cos(x*p)*p/q; f/=-2; }   return(r); } }

class multicos extends function { double y(double x) { double r=0, f=1; int p=1, q=-1; for(p<100000;q-=(p-=q)) { r+=Math.cos(x*p)/q; f/=-2; }   return(r); } double dydx(double x) { double r=0, f=1; int p=1, q=-1; for(p<100000;q-=(p-=q)) { r-=Math.sin(x*p)*p/q; f/=-2; }   return(r); } }

class parax extends function { function r; parax(function rr) { r=rr; } double y(double x) { return(r.y(x)*Math.sin(x)); } double dydx(double x) { return(r.dydx(x)*Math.sin(x)+r.y(x)*Math.cos(x)); } }

class paray extends function { function r; paray(function rr) { r=rr; } double y(double x) { return(r.y(x)*Math.cos(x)); } double dydx(double x) { return(r.dydx(x)*Math.cos(x)-r.y(x)*Math.sin(x)); } }

class expinvsqlau extends function { int n; expinvsqlau(int nn) { n=nn; } double y(double x) { double f=1, r=0, t;   int j, k=0, i;    for(j=0;j<n+1;++j) { for(i=0,t=1;i<k;++i) t/=-x*x; r+=t*f; ++k; f/=k; }   return(r); } double dydx(double x) { double f=1, r=0, t;   int j, k=0, i;    for(j=0;j.00001||p-t>.00001)&&n<1000;++n) { p=t; t+=b/(4*n+3); b*=x4/((2*n+2)*(2*n+3)); }   return(t); } double dydx(double x) { return(Math.sin(x*x)); } }

class fresC extends function { double y(double x) { double t=0, x4=-x*x*x*x, b=x, p=-10; for(int n=0;(t-p>.00001||p-t>.00001)&&n<1000;++n) { p=t; t+=b/(4*n+1); b*=x4/((2*n+1)*(2*n+2)); }   return(t); } double dydx(double x) { return(Math.cos(x*x)); } }

class erf extends function { int e; double w=1/Math.sqrt(3.141592653589793238462643383); erf(int ee) { e=ee; for(ee>1;--ee) w*=ee; } double y(double x) { double t=0, x4=-Math.pow(x, e), b=x*w, p=-10; for(int n=0;(t-p>.00001||p-t>.00001)&&n<1000;++n) { p=t; t+=b/(e*n+1); b*=x4/(n+1); }   return(t); } double dydx(double x) { return(w*Math.exp(-Math.pow(x, e))); } }

class check extends function { erf a=new erf(3); double y(double x) { return(1+(a.y(x+.001)-a.y(x-.001))*500-a.dydx(x)); } double dydx(double x) { return(0); } }

title: User:Cyp/Java