-- This is a test HyperFun File Provided by the HyperFun Team -- (www.hyperfun.org) -- 6D object -- Coordinates: x1 - x; x2 - y; x3 - z; -- x4 - phase; x5 - frequency; x6 - radius; -- To get a single star X assign: x, y, z, 1., 1.5, 3. -- A params: a[1] = 2.5, a[2] = 1.1 -- Types for animated spreadsheet: x1 - x; x2 - y; x3 - z; -- x4 - t; x5 - u; x6 - v; -- t=0, 1, 2; u=0, 1.5, 3; v=1, 2, 3; -- intervals for x,y,z: [-7 7], [-7 7], [-1.5 1.5] -- Cartesian to cylindrical coordinates transformation -- x1 - Phi, x2 - Ro, x3 - Z Star6(x[6],a[2]){ pi = 3.1418; pi2 = 1.5709; eps = 0.000001; x2 = sqrt(x[1]^2+x[2]^2); x1 = 0.; if(abs(x2) > eps) then c = x[1]/x2; if(abs(c) < eps) then x1 = pi2; -- if(x[2] < 0.) then x1=-pi2; endif; else x1 = atan(sqrt(1-c^2)/c); if(x[1] < 0.) then x1 = x1+pi; endif; endif; endif; x3=x[3]; -- Radius oscillation -- a[1]=2.5; s = sin((x[5]+x[4])*x1); xs2 = x2-a[1]*s^2; -- Cartesian product: disk in (Ro,Z) plane and -- segment on Phi axis -- a[2] = 1.1 xs2 = xs2 - x[6]; disk = a[2]^2-xs2^2-x3^2; segment = (x1+0.5) & (2.*pi+0.5-x1); Star6 = disk @ segment; }