rotate using the mouse, click to stop time
This is a 4 Dimensional graph, where Z is defined in terms of X,Y, and t (time). (more examples will be coming soon) Here, Z = (30/(((x+8*sin((-t-100/50)*1.3))^2+(y+10*cos(2.2*(-t-100/50)),2)^2)+4)+.1)*sin(sqrt((x+8*sin((-t-100/50)*1.3))^2+(y+10*cos(2.2*(-t-100/50)),2)^2)*0.8+t)-25/((x-8*sin((-t-100/50)*1.33))^2+(y-10*cos((-t-100/50)*0.82))^2+4)+.2*sin(sqrt((x-8*sin((-t-100/50)*1.33))^2+(y-10*cos((-t-100/50)*0.82))^2)+t*1.3)
This function gives the effect of two sources of waves in a liquid, moving around slowly in random directions. Here is how I came up with this function:
(this is in JAVA, so some things are a little different: double just means it is a number, Math.pow(x,2) is saying x^2, the rest is understandable)
t += 100; // add 100 to
t. this part was an afterthought, to put things at an interesting situation. It
is boring at t=0.
t = -t; //t is inverted so the waves are moving outward from the wave sources
instead of inward
double tinc = t/50; //this is just time moving slower (t increment), it is used
to slowly move the two sources of waves...
double x1 = 8*Math.sin(tinc*1.3);// x1 and y1 are the coordinates of one
wave source.
double y1 = 10*Math.cos(tinc*2.2); // this wave source moves slowly in a path defined by this
(x1,y1) parametric set of equations.
double x2 = 8*Math.sin(tinc*1.33);//here is the same idea, only this path is
different from the first (the time coefficients are pretty much arbitrary)
double y2 = 10*Math.cos(tinc*0.82);//this is so they interact with each other,
otherwise the two sources would always be in the same exact place
double d = Math.sqrt(Math.pow(x+x1,2)+Math.pow(y+y1,2)); //this is the distance
from the point (x1,y1), using the Pythagorean theorem
double witch = 30/(d*d+4)+.1;//this is the witch of Agnesi : y =
a3/(x2 + a2)
, but in terms of the distance from (x1,y1) instead of y
// The witch of Agnesi gives the underlying shape to each wave source: high at
the origin and dying with distance
double pnt1 = witch*Math.sin(d*0.8+t);//here, the shape is modulated by a sine
wave. This sine wave is in terms of distance from (x1,y1) + time,
//so it originates at the point (x1,y1) and moves outward as time passes
d = Math.sqrt(Math.pow(x-x2,2)+Math.pow(y-y2,2));//here, the same principles are
applied to create a second source of waves
witch = 25/(d*d+4)+.2;
double pnt2 = witch*Math.sin(d+t*1.3); //there is a coefficient with time only
to create some offset, so the waves are asynchronous
Z = pnt1-pnt2;//the end result is achieved by putting the two curves on top of
each other. (by subtraction or addition, the effect is the same)