{
	"patcher" : 	{
		"fileversion" : 1,
		"appversion" : 		{
			"major" : 8,
			"minor" : 0,
			"revision" : 0,
			"architecture" : "x64",
			"modernui" : 1
		}
,
		"rect" : [ 398.0, 79.0, 872.0, 798.0 ],
		"bgcolor" : [ 0.9, 0.9, 0.9, 1.0 ],
		"editing_bgcolor" : [ 0.9, 0.9, 0.9, 1.0 ],
		"bglocked" : 0,
		"openinpresentation" : 0,
		"default_fontsize" : 12.0,
		"default_fontface" : 0,
		"default_fontname" : "Arial",
		"gridonopen" : 1,
		"gridsize" : [ 15.0, 15.0 ],
		"gridsnaponopen" : 1,
		"objectsnaponopen" : 1,
		"statusbarvisible" : 0,
		"toolbarvisible" : 1,
		"lefttoolbarpinned" : 0,
		"toptoolbarpinned" : 0,
		"righttoolbarpinned" : 0,
		"bottomtoolbarpinned" : 0,
		"toolbars_unpinned_last_save" : 0,
		"tallnewobj" : 0,
		"boxanimatetime" : 200,
		"enablehscroll" : 1,
		"enablevscroll" : 1,
		"devicewidth" : 0.0,
		"description" : "",
		"digest" : "",
		"tags" : "",
		"style" : "",
		"subpatcher_template" : "",
		"title" : "superf3D.genjit",
		"boxes" : [ 			{
				"box" : 				{
					"fontname" : "Arial",
					"fontsize" : 12.0,
					"id" : "obj-7",
					"maxclass" : "newobj",
					"numinlets" : 1,
					"numoutlets" : 0,
					"patching_rect" : [ 753.0, 658.0, 37.0, 22.0 ],
					"presentation_rect" : [ 753.0, 658.0, 37.0, 22.0 ],
					"style" : "",
					"text" : "out 2"
				}

			}
, 			{
				"box" : 				{
					"fontname" : "Arial",
					"fontsize" : 12.0,
					"id" : "obj-2",
					"maxclass" : "newobj",
					"numinlets" : 0,
					"numoutlets" : 1,
					"outlettype" : [ "" ],
					"patching_rect" : [ 642.0, 47.0, 121.0, 22.0 ],
					"presentation_rect" : [ 642.0, 47.0, 121.0, 22.0 ],
					"style" : "",
					"text" : "param n2 0.1 1.3 1.7"
				}

			}
, 			{
				"box" : 				{
					"fontname" : "Arial",
					"fontsize" : 12.0,
					"id" : "obj-6",
					"maxclass" : "newobj",
					"numinlets" : 0,
					"numoutlets" : 1,
					"outlettype" : [ "" ],
					"patching_rect" : [ 511.0, 47.0, 108.0, 22.0 ],
					"presentation_rect" : [ 511.0, 47.0, 108.0, 22.0 ],
					"style" : "",
					"text" : "param amp2 1 1 5"
				}

			}
, 			{
				"box" : 				{
					"fontname" : "Arial",
					"fontsize" : 12.0,
					"id" : "obj-9",
					"maxclass" : "newobj",
					"numinlets" : 0,
					"numoutlets" : 1,
					"outlettype" : [ "" ],
					"patching_rect" : [ 331.0, 47.0, 121.0, 22.0 ],
					"presentation_rect" : [ 331.0, 47.0, 121.0, 22.0 ],
					"style" : "",
					"text" : "param n1 0.1 1.3 1.7"
				}

			}
, 			{
				"box" : 				{
					"fontname" : "Arial",
					"fontsize" : 12.0,
					"id" : "obj-5",
					"maxclass" : "newobj",
					"numinlets" : 0,
					"numoutlets" : 1,
					"outlettype" : [ "" ],
					"patching_rect" : [ 200.0, 47.0, 108.0, 22.0 ],
					"presentation_rect" : [ 200.0, 47.0, 108.0, 22.0 ],
					"style" : "",
					"text" : "param amp1 1 1 5"
				}

			}
, 			{
				"box" : 				{
					"fontname" : "Arial",
					"fontsize" : 12.0,
					"id" : "obj-1",
					"maxclass" : "newobj",
					"numinlets" : 0,
					"numoutlets" : 1,
					"outlettype" : [ "" ],
					"patching_rect" : [ 90.0, 47.0, 30.0, 22.0 ],
					"presentation_rect" : [ 90.0, 47.0, 30.0, 22.0 ],
					"style" : "",
					"text" : "in 1"
				}

			}
, 			{
				"box" : 				{
					"code" : "// 2D superformula, phi in range [0, 1]\r\nsuperformula(p, a, n) {\r\n\tC = pow(abs(1/a.x * cos(a.z*p*pi*0.5)), n.y);\r\n\tS = pow(abs(1/a.y * sin(a.z*p*pi*0.5)), n.z);\r\n\treturn pow(C+S, -1/n.x);\r\n}\r\n\r\nsuperformula3D(coord, a1, n1, a2, n2) {\r\n\t// polar coordinates\r\n\tr1 = superformula(coord.x, a1, n1);\r\n\ttheta = coord.x;\r\n\r\n\tr2 = superformula(coord.y, a2, n2);\r\n\tp = coord.y;\r\n\t\r\n\tr1r2 = r1*r2;\r\n\t// cartesian coordinates\r\n\treturn vec(r1r2, r1r2, r2)*sphere(vec(theta, p));\r\n\r\n}\r\n\r\npos = superformula3D(in1, in2, in3, in4, in5);\r\ncolor = abs(pos);\r\n\r\nout1 = pos;\r\nout2 = color;\r\n",
					"fontface" : 0,
					"fontname" : "Arial",
					"fontsize" : 12.0,
					"id" : "obj-3",
					"maxclass" : "codebox",
					"numinlets" : 5,
					"numoutlets" : 2,
					"outlettype" : [ "", "" ],
					"patching_rect" : [ 90.0, 92.0, 682.0, 548.0 ],
					"presentation_rect" : [ 90.0, 92.0, 682.0, 548.0 ],
					"style" : ""
				}

			}
, 			{
				"box" : 				{
					"fontname" : "Arial",
					"fontsize" : 12.0,
					"id" : "obj-4",
					"maxclass" : "newobj",
					"numinlets" : 1,
					"numoutlets" : 0,
					"patching_rect" : [ 90.0, 658.0, 37.0, 22.0 ],
					"presentation_rect" : [ 90.0, 658.0, 37.0, 22.0 ],
					"style" : "",
					"text" : "out 1"
				}

			}
 ],
		"lines" : [ 			{
				"patchline" : 				{
					"destination" : [ "obj-3", 0 ],
					"source" : [ "obj-1", 0 ]
				}

			}
, 			{
				"patchline" : 				{
					"destination" : [ "obj-3", 4 ],
					"source" : [ "obj-2", 0 ]
				}

			}
, 			{
				"patchline" : 				{
					"destination" : [ "obj-4", 0 ],
					"source" : [ "obj-3", 0 ]
				}

			}
, 			{
				"patchline" : 				{
					"destination" : [ "obj-7", 0 ],
					"source" : [ "obj-3", 1 ]
				}

			}
, 			{
				"patchline" : 				{
					"destination" : [ "obj-3", 1 ],
					"source" : [ "obj-5", 0 ]
				}

			}
, 			{
				"patchline" : 				{
					"destination" : [ "obj-3", 3 ],
					"source" : [ "obj-6", 0 ]
				}

			}
, 			{
				"patchline" : 				{
					"destination" : [ "obj-3", 2 ],
					"source" : [ "obj-9", 0 ]
				}

			}
 ]
	}

}
