Polynomials for Toratopes

Discussion of shapes with curves and holes in various dimensions.

Polynomials for Toratopes

Postby ICN5D » Mon Aug 04, 2014 1:36 am

So, I found that the implicit surface of a torus can be solved into a quartic polynomial, making

(sqrt(x^2 + y^2) - R1)^2 + z^2 - R2^2 = 0

into

(x^2+y^2+z^2+R1^2-R2^2)^2 - 4R1^2(x^2+y^2) = 0

And, what I was thinking about, was if we solved this polynomial for xy or xz. It seems like it would become two circles, displaced or concentric. That is, we would derive its plane intercepts into exact solutions of two circles. They would be 2 discrete quadratic polynomials, acting as roots to the quartic. It's funny how I'm learning all of this backwards. Explore hypershapes first, then learn the math.

(x^2+y^2+z^2+R1^2-R2^2)^2 - 4R1^2(x^2+y^2) = xy

sets z=0 , and should make

(x^2+y^2+x+y-(R1+R2))*(x^2+y^2+x+y-(R1-R2)) = z

Where their diameters R1 are equidistant to the cut open R2



and,

(x^2+y^2+z^2+R1^2-R2^2)^2 - 4R1^2(x^2+y^2) = xz

sets y=0, and should make

((x+R1)^2+z^2+(x+R1)+z-R2)*((x-R1)^2+z^2+(x-R1)+z-R2) = y

Where their centers are equidistant to the cut open R1 along X



There might be some errors in that. I also have no clue how to do those calculations, but I'd like to learn. It makes me think about higher toratopes. If the ditorus can make 8 x-intercepts, it needs an 8 degree polynomial. Same for a tiger, which comes out as all complex, or half real and complex, for x. It seems like complex roots are another way of saying 'empty cut'. The whole shape is still there, just not intercepting the plane that was set to zero. Like a parabola that's in the +x+y quadrant. It has complex roots, because it's translated away from the x-plane. It lies outside the 1st dimension. So, if we cut to empty, we have all complex roots. But, translating out makes real roots and complex, as we see only half the shape.

So, if solving for some 2-plane, the 8 degree poly for a ditorus should have four exact roots of four circles. These four would be spaced apart in an array corresponding exactly to the diameters that were cut open. A tiger would have four circle intercepts as well, one in each quadrant. A tiger also seems it would have a more complex polynomial, as it introduces an implicit where the coefficients are polynomials.

Being that we're working with discrete surfaces, we can also solve for discrete and exact roots of lower polynomials. Crazy thing is, the cut algorithm has already pre-derived every solution ahead of time. Like the intercept array of a 6D toratope. We get at most 8 tori, in an array spaced apart from cut diameters. Which is 8 quartic polynomials as the 3D intercept 'points' of a hypershape. That 5D surface has a 32 degree polynomial, and we can derive every single one of its exact solutions for comparison. That sounds kind of interesting, and perhaps an avenue of research. Maybe it'll shed some light on root finding algorithms. It also might be a valuable proof system, to show how the discrete polynomials have several discrete roots, in various hyperplanes.


This also means, for base-species toratopes,

dimension - degree of poly
----------------------------------
1D - 1 degree
2D - 2
3D - 4
4D - 8
5D - 16
6D - 32
7D - 64
8D - 128
9D - 256
10D - 512

degree = 2^(1-dim)

or, as a better generalization, consider the amount of distinct diameters, and

degree = 2^(Rsum)


So, if the implicits for 4 of the five 4D toratopes are:


((III)I) = (sqrt(x^2 + y^2 + z^2) - R1)^2 + w^2 - R2^2 = 0

(((II)I)I) = (sqrt((sqrt(x^2 + y^2) - R1)^2 + z^2) - R2)^2 + w^2 - R3^2 = 0

((II)II) = (sqrt(x^2 + y^2) - R1)^2 + z^2 + w^2 - R2^2 = 0

((II)(II)) = (sqrt(x^2 + y^2) - R1a)^2 + (sqrt(z^2 + w^2) - R1b)^2 - R2^2 = 0


how does one go about making them polynomials? Or, is there an easier way using the torus quartic? Maybe, actually.


EDIT: made some minor corrections to the torus quartic intercepts
It is by will alone, I set my donuts in motion
ICN5D
Pentonian
 
Posts: 1135
Joined: Mon Jul 28, 2008 4:25 am
Location: the Land of Flowers

Re: Polynomials for Toratopes

Postby PWrong » Tue Aug 05, 2014 6:33 am

((III)I) = (sqrt(x^2 + y^2 + z^2) - R1)^2 + w^2 - R2^2 = 0

(((II)I)I) = (sqrt((sqrt(x^2 + y^2) - R1)^2 + z^2) - R2)^2 + w^2 - R3^2 = 0

((II)II) = (sqrt(x^2 + y^2) - R1)^2 + z^2 + w^2 - R2^2 = 0

((II)(II)) = (sqrt(x^2 + y^2) - R1a)^2 + (sqrt(z^2 + w^2) - R1b)^2 - R2^2 = 0

how does one go about making them polynomials? Or, is there an easier way using the torus quartic? Maybe, actually.


It's a pretty straightforward rearrangement. However some of those will turn out to be octic equations.
User avatar
PWrong
Pentonian
 
Posts: 1599
Joined: Fri Jan 30, 2004 8:21 am
Location: Perth, Australia

Re: Polynomials for Toratopes

Postby ICN5D » Wed Aug 06, 2014 4:43 am

And, those are something I'd love to see. There's patterns in it for sure!
It is by will alone, I set my donuts in motion
ICN5D
Pentonian
 
Posts: 1135
Joined: Mon Jul 28, 2008 4:25 am
Location: the Land of Flowers

Re: Polynomials for Toratopes

Postby Marek14 » Wed Aug 06, 2014 8:03 am

ICN5D wrote:((III)I) = (sqrt(x^2 + y^2 + z^2) - R1)^2 + w^2 - R2^2 = 0

(((II)I)I) = (sqrt((sqrt(x^2 + y^2) - R1)^2 + z^2) - R2)^2 + w^2 - R3^2 = 0

((II)II) = (sqrt(x^2 + y^2) - R1)^2 + z^2 + w^2 - R2^2 = 0

((II)(II)) = (sqrt(x^2 + y^2) - R1a)^2 + (sqrt(z^2 + w^2) - R1b)^2 - R2^2 = 0


If torus is (x^2+y^2+z^2+R1^2-R2^2)^2 - 4R1^2(x^2+y^2) = 0, then torisphere should be
(x^2+y^2+z^2+w^2+R1^2-R2^2)^2 - 4R1^2(x^2+y^2+z^2) = 0
and spheritorus should be
(x^2+y^2+z^2+w^2+R1^2-R2^2)^2 - 4R1^2(x^2+y^2) = 0

This seems similar to the old parametric equation approach which put torus as

x = r*cos(t)*cos(u) + R*cos(t)
y = r*sin(t)*cos(u) + R*sin(t)
z = r*sin(u)

Note that u affects all 3 dimensions while t only affects x and y.

Now, if we square all of these, we get
x^2 = r^2*cos(t)^2*cos(u)^2 + 2*R*r*cos(t)^2*cos(u) + R^2*cos(t)^2
y^2 = r^2*sin(t)^2*cos(u)^2 + 2*R*r*sin(t)^2*cos(u) + R^2*sin(t)^2
z^2 = r^2*sin(u)^2

x^2 + y^2 = r^2*cos(u)^2 + 2*R*r*cos(u) + R^2
x^2 + y^2 + z^2 = r^2 + R^2 + 2*R*r*cos(u)
This means that (x^2 + y^2 + z^2 - R^2 - r^2)^2 = 4*R^2*r^2*cos(u)^2
Now, since z^2 = r^2*sin(u)^2, we can put
4*R^2*z^2 = 4*R^2*r^2*sin(u)^2

and adding both equations leads to
(x^2 + y^2 + z^2 - R^2 - r^2)^2 + 4*R^2*z^2 = 4*R^2*r^2

Hm, looks like a different equation from yours... I can't access Calc3Dright now due to JAVA update, so you might want to check both equations there to see if they do, indeed, make a torus.
Marek14
Pentonian
 
Posts: 1191
Joined: Sat Jul 16, 2005 6:40 pm

Re: Polynomials for Toratopes

Postby PWrong » Wed Aug 06, 2014 8:20 am

Actually this will be fairly important, because the definitions with square roots aren't really accurate. Without a +/- sign, they only give half of the shape, or worse.
User avatar
PWrong
Pentonian
 
Posts: 1599
Joined: Fri Jan 30, 2004 8:21 am
Location: Perth, Australia

Re: Polynomials for Toratopes

Postby Marek14 » Wed Aug 06, 2014 8:36 am

PWrong wrote:Actually this will be fairly important, because the definitions with square roots aren't really accurate. Without a +/- sign, they only give half of the shape, or worse.


Not really, the square root definitions DO give the whole shape (we've been using them in Calc3D for some time).
Marek14
Pentonian
 
Posts: 1191
Joined: Sat Jul 16, 2005 6:40 pm

Re: Polynomials for Toratopes

Postby ICN5D » Wed Aug 06, 2014 6:47 pm

I think using just the cartesian implicit function overcomes the square root problem. If converting into a polynomial, then solving for exact roots, the +/- sign has to be used. It allows two shapes to exist, as translated copies equidistant from a cut open higher diameter.

That's why I used

(x^2+y^2+x+y-(R1+R2))*(x^2+y^2+x+y-(R1-R2)) = z

for the circle intercepts for a quartic torus polynomial. The circles have a radius R1 set to exact values from the sliced open R2, as +/- from the square root. Though, if graphing as an explicit function, four simultaneous equations will have to be used, as only half the circles will appear. That's the square root problem with graphing. Luckily, using just the implicit function in Cartesian coordinates in CalcPlot3D overcomes this obstacle, and makes exactly what it should be. I tried to graph the torisphere implicit in Mathematica 10, but there's errors in the calculation.
It is by will alone, I set my donuts in motion
ICN5D
Pentonian
 
Posts: 1135
Joined: Mon Jul 28, 2008 4:25 am
Location: the Land of Flowers

Re: Polynomials for Toratopes

Postby Marek14 » Wed Aug 06, 2014 6:52 pm

ICN5D wrote:I think using just the cartesian implicit function overcomes the square root problem. If converting into a polynomial, then solving for exact roots, the +/- sign has to be used. It allows two shapes to exist, as translated copies equidistant from a cut open higher diameter.

That's why I used

(x^2+y^2+x+y-(R1+R2))*(x^2+y^2+x+y-(R1-R2)) = z

for the circle intercepts for a quartic torus polynomial. The circles have a radius R1 set to exact values from the sliced open R2, as +/- from the square root. Though, if graphing as an explicit function, four simultaneous equations will have to be used, as only half the circles will appear. That's the square root problem with graphing. Luckily, using just the implicit function in Cartesian coordinates in CalcPlot3D overcomes this obstacle, and makes exactly what it should be. I tried to graph the torisphere implicit in Mathematica 10, but there's errors in the calculation.


Did you try the quartic polynomials (yours and mine) in Calc3D?
Marek14
Pentonian
 
Posts: 1191
Joined: Sat Jul 16, 2005 6:40 pm

Re: Polynomials for Toratopes

Postby ICN5D » Fri Aug 08, 2014 3:16 am

Yeah, it came out correctly! I used (x^2 + y^2 + z^2 - 10)^2 + 36z^2 - 36 = 0 and the original (x^2+y^2+z^2+8)^2 - 36(x^2+y^2) = 0 . They came out exactly identical, which is really cool. When I found out that I've been writing 32 and 64 degree polynomials, it totally blew my mind. In fact, that equation for (((((II)I)(II))I)((II)I)) is 256 degree. Holy cow. So, it seems that the torus quartic can be used for the non-intersecting rotations, by replacing z with sqrt(z^2 + w^2), and eliminating the square roots. Going by this to make a tiger polynomial:

Setting
R = 3
r = 1


(x^2 + y^2 + z^2 - 10)^2 + 36z^2 - 36 = 0

shift torus along z by equal diameter of major
(x^2 + y^2 + (z-3)^2 - 10)^2 + 36(z-3)^2 - 36 = 0

replace z with sqrt(z^2 + w^2)
(x^2 + y^2 + (sqrt(z^2 + w^2)-3)^2 - 10)^2 + 36(sqrt(z^2 + w^2)-3)^2 - 36 = 0

and, of course, I'm not sure how to proceed from here.
It is by will alone, I set my donuts in motion
ICN5D
Pentonian
 
Posts: 1135
Joined: Mon Jul 28, 2008 4:25 am
Location: the Land of Flowers

Re: Polynomials for Toratopes

Postby Marek14 » Fri Aug 08, 2014 5:44 am

We can start from first principles, the parametric equation.

x = r*cos(t)*cos(v) + R1*cos(t)
y = r*sin(t)*cos(v) + R1*sin(t)
z = r*cos(u)*sin(v) + R2*cos(u)
w = r*sin(u)*sin(v) + R2*sin(u)

x^2 = r^2*cos(t)^2*cos(v)^2 + 2*R1*r*cos(t)^2*cos(v) + R1^2*cos(t)^2
y^2 = r^2*sin(t)^2*cos(v)^2 + 2*R1*r*sin(t)^2*cos(v) + R1^2*sin(t)^2
z^2 = r^2*cos(u)^2*sin(v)^2 + 2*R2*r*cos(u)^2*sin(v) + R2^2*cos(u)^2
w^2 = r^2*sin(u)^2*sin(v)^2 + 2*R2*r*sin(u)^2*sin(v) + R2^2*sin(u)^2

x^2 + y^2 = R1^2 + 2*R1*r*cos(v) + r^2*cos(v)^2
z^2 + w^2 = R2^2 + 2*R2*r*sin(v) + r^2*sin(v)^2
x^2 + y^2 + z^2 + w^2 = R1^2 + R2^2 + r^2 + 2*R1*r*cos(v) + 2*R2*r*sin(v)
x^2 + y^2 + z^2 + w^2 - R1^2 - R2^2 - r^2 = 2*R1*r*cos(v) + 2*R2*r*sin(v)

(x^2 + y^2 + z^2 + w^2 - R1^2 - R2^2 - r^2)^2 = 4*R1^2*r^2*cos(v)^2 + 8*R1*R2*r^2*cos(v)*sin(v) + 4*R2^2*r^2*sin(v)^2
4*R2^2*(x^2 + y^2) = 4*R1^2*R2^2 + 8*R1*R2^2*r*cos(v) + 4*R2^2*r^2*cos(v)^2
4*R1^2*(z^2 + w^2) = 4*R1^2*R2^2 + 8*R1^2*R2*r*sin(v) + 4*R1^2*r^2*sin(v)^2
(x^2 + y^2 + z^2 + w^2 - R1^2 - R2^2 - r^2)^2 + 4*R2^2*(x^2 + y^2) + 4*R1^2*(z^2 + w^2) = 8*R1^2*R2^2 + 4*R1^2*r^2 + 4*R2^2*r^2 + 8*R1*R2*r^2*cos(v)*sin(v) + 8*R1*R2^2*r*cos(v) + 8*R1^2*R2*r*sin(v)
(x^2 + y^2 + z^2 + w^2 - R1^2 - R2^2 - r^2)^2 + 4*R2^2*(x^2 + y^2) + 4*R1^2*(z^2 + w^2) - 8*R1^2*R2^2 - 4*R1^2*r^2 - 4*R2^2*r^2 = 8*R1*R2*r^2*cos(v)*sin(v) + 8*R1*R2^2*r*cos(v) + 8*R1^2*R2*r*sin(v)

Not sure how to continue from here, there's one more squaring to do (tiger should have degree-8 equation), but I should probably add some other term before that.
However, notice that the equation can be simplified if we put both major radii equal:

(x^2 + y^2 + z^2 + w^2 - 2*R^2 - r^2)^2 = 4*R^2*r^2*cos(v)^2 + 8*R^2*r^2*cos(v)*sin(v) + 4*R^2*r^2*sin(v)^2
(x^2 + y^2 + z^2 + w^2 - 2*R^2 - r^2)^2 = 4*R^2*r^2 + 8*R^2*r^2*cos(v)*sin(v)
(x^2 + y^2 + z^2 + w^2 - 2*R^2 - r^2)^2 - 4*R^2*r^2 = 8*R^2*r^2*cos(v)*sin(v)
(x^2 + y^2 + z^2 + w^2 - 2*R^2 - r^2)^2 - 4*R^2*r^2 = 4*R^2*r^2*sin(2*v)

Still not sure how to continue...
Marek14
Pentonian
 
Posts: 1191
Joined: Sat Jul 16, 2005 6:40 pm

Re: Polynomials for Toratopes

Postby ICN5D » Tue Aug 12, 2014 3:02 am

Hmm, I'm not sure either. This one might be easier, based on the first torus quartic:

(x^2+y^2+(sqrt(z^2 + w^2)-R3)^2+R1^2-R2^2)^2 - 4R1^2(x^2+y^2) = 0

This way it only has one square root to eliminate.
It is by will alone, I set my donuts in motion
ICN5D
Pentonian
 
Posts: 1135
Joined: Mon Jul 28, 2008 4:25 am
Location: the Land of Flowers

Re: Polynomials for Toratopes

Postby ICN5D » Wed Oct 01, 2014 10:23 pm

All right! So, I tested a few equations in a neat 2D implicit grapher. Real similar to the first method posted, by reverse deriving the solutions to the torus quartic polynomial.

f(xyz) = (x^2 + y^2 + z^2 + R^2 - r^2)^2 - 4R^2*(x^2 + y^2)

and

f(xyz) = (x^2 + y^2 + z^2 - R^2 - r^2)^2 + 4R^2*(z^2 - r^2)



And, I tested:

((II))
f(xy) = (x^2 + y^2 - (R-r)^2) * (x^2 + y^2 - (R+r)^2))

and

((I)I)
f(xz) = ((x-R)^2 + z^2 - r^2) * ((x+R)^2 + z^2 - r^2)


Both work perfectly. So, solving for any 2D plane will somehow make those two copies of a circle quadratic, in a nicely symmetrical layout. I'm thinking there's some higher level patterns to learn in these polynomials, to find these solutions. Hopefully, without having to fully expand the first term. The torus quartic fully expanded is:

(x^2 + y^2 + z^2 + R^2 - r^2)^2 - 4R^2*(x^2 + y^2) = 0

expands into

x^4 + y^4 + z^4 + R^4 + r^4 + 2(xy)^2 + 2(xz)^2 + 2(yz)^2 - 2(Rx)^2 - 2(rx)^2 - 2(Ry)^2 - 2(ry)^2 + 2(Rz)^2 - 2(rz)^2 - 2(Rr)^2 = 0

Which graphs correctly. There may be other ways to simplify this, to make it easier to solve intercepts.



First thing I see is the (x^2 + y^2 + z^2 + R^2 - r^2)^2 term, which becomes two circles after removing Y or Z, and expanding into

(x^2 + y^2 + R^2 - r^2) * (x^2 + y^2 + R^2 - r^2)

Then, there's the extra term that lies outside it , the -4R^2*(x^2 + y^2) . This one seems to have commutative propeties within the two circle terms, which solve into the above tested roots. Because the roots have this layout, there exists a systematic method to derive them, whether known or not.

I also imagine solving for x can make:

f(x) = (x - R + r)*(x - R - r)*(x + R - r)*(x + R + r)

for the 4 x-intercepts, and hence the 4-degree poly.

Observing how these polynomials work, I can see how one of the degree-8's for ditorus or tiger can have two copies of a torus quartic, for example:


((x^2 + y^2 + z^2 +w^2 + Ra^2 + Rb^2 - r^2)^2 - 4Ra^2*Rb^2*(x^2 + y^2))^2


or something like that, with the extra terms after it. Then, this term can expand and solve into four circles, spaced apart by Ra and Rb. I'm thinking that a possible solution to the tiger octic may be something like :

Arrangement ((II)(I))
f(xyz) = ((x^2 + y^2 + (z - Rb)^2 + Ra^2 - r^2)^2 - 4Ra^2*(x^2 + y^2)) * ((x^2 + y^2 + (z + Rb)^2 + Ra^2 - r^2)^2 - 4Ra^2*(x^2 + y^2))

((I)(I))
f(xz) = ((x-Ra)^2 + (y-Rb)^2 - r^2) * ((x-Ra)^2 + (y+Rb)^2 - r^2) * ((x+Ra)^2 + (y-Rb)^2 - r^2) * ((x+Ra)^2 + (y+Rb)^2 - r^2)



and the ditorus, (((R1)R2)R3) :

Arrangement (((I)I)I)
f(xzw) = (((x - R1)^2 + y^2 + z^2 - R2^2 - R3^2)^2 + 4R2^2*(z^2 - R3^2)) * (((x + R1)^2 + y^2 + z^2 - R2^2 - R3^2)^2 + 4R2^2*(z^2 - R3^2))


Arrangement (((II))I)
f(xyw) = ((x^2 + y^2 + z^2 - (R1 - R2)^2 - R3^2)^2 + 4(R1 - R2)^2*(z^2 - R3^2)) * ((x^2 + y^2 + z^2 - (R1 + R2)^2 - R3^2)^2 + 4(R1 + R2)^2*(z^2 - R3^2))


Arrangement (((II)I))
f(xyz) = ((x^2 + y^2 + z^2 - R2^2 - (R2 - R3)^2)^2 + 4R2^2*(z^2 - (R2 - R3)^2)) * ((x^2 + y^2 + z^2 - R2^2 - (R2 + R3)^2)^2 + 4R2^2*(z^2 - (R2 + R3)^2))


(((I))I)
f(xw) = ((x-R1+R2)^2 + y^2 - R3^2) * ((x-R1-R2)^2 + y^2 - R3^2) * ((x+R1-R2)^2 + y^2 - R3^2) * ((x+R1+R2)^2 + y^2 - R3^2)

(((I)I))
f(xz) = ((x-R1)^2 + y^2 - (R2+R3)^2) * ((x-R1)^2 + y^2 - (R2-R3)^2) * ((x+R1)^2 + y^2 - (R2+R3)^2) * ((x+R1)^2 + y^2 - (R2-R3)^2)

(((II)))
f(xy) = (x^2 + y^2 - (R1-R2-R3)^2) * (x^2 + y^2 - (R1-R2+R3)^2) * (x^2 + y^2 - (R1+R2-R3)^2) * (x^2 + y^2 - (R1+R2+R3)^2)


Plus, there's several complex roots to these octics, too. That's what an empty cut is, when the shape doesn't intercept the plane we're solving for, making imaginary roots in the complex plane. This puts an interesting spin on interpreting and visualizing the complex plane. In this case, it's an empty cut, but translating out makes an intercept come into view, into the real plane. When doing so, the roots lie half in the real and half in the complex plane. The complex conjugate values come from the diameter value that locates the second intercept of the ring.

The process in deriving those solutions is probably insane and awesome. But, maybe those degree-8's are special in a ways that makes it straightforward. Sounds like really interesting stuff, in exploring a root-finding algorithm. I think what's neat is being able to work in reverse, and knowing what it's supposed to be ahead of time. I wonder, is there a way to derive the full quartic for a torus, out of the one for its circle intercepts?
It is by will alone, I set my donuts in motion
ICN5D
Pentonian
 
Posts: 1135
Joined: Mon Jul 28, 2008 4:25 am
Location: the Land of Flowers

Re: Polynomials for Toratopes

Postby PWrong » Thu Oct 02, 2014 5:35 am

This actually seems like an interesting problem in general. Given an equation containing polynomials and square roots and several variables, how do you convert it into just a polynomial equation with no square roots?

This page might help in some way.
http://www.mathpages.com/home/kmath111/kmath111.htm
User avatar
PWrong
Pentonian
 
Posts: 1599
Joined: Fri Jan 30, 2004 8:21 am
Location: Perth, Australia

Re: Polynomials for Toratopes

Postby PWrong » Thu Oct 02, 2014 6:15 am

So for the tiger, we can easily reduce the equation to

x^2 +y^2 + z^2 + w^2 + a^2 + b^2 - R^2 = 2a sqrt(x^2 + y^2) + 2b sqrt(z^2 + y^2).

Denote
A = 4a^2 (x^2 + y^2)
B = 4b^2 (z^2 + w^2)
X = x^2 +y^2 + z^2 + w^2 + a^2 + b^2 - R^2

Then using the technique from the link I just posted,
(X^2 - (A + B)^2)^2 - 4AB = 0.


That general idea should be enough to get the full polynomials for all the 4D toratopes and most of the 5D toratopes. For a shape like (222), we'll need the higher order equations from the link. For something like ((21)2) it might be much harder.
User avatar
PWrong
Pentonian
 
Posts: 1599
Joined: Fri Jan 30, 2004 8:21 am
Location: Perth, Australia

Re: Polynomials for Toratopes

Postby PWrong » Thu Oct 02, 2014 10:35 am

I figured out a way to naively expand toratopes out in Mathematica. I haven't checked if the results are correct yet, will do that now.

NoRoots[f] expands out f, and then collects only the parts that have no square roots.
Code: Select all
NoRoots[f_] :=
Flatten[CoefficientList[Expand[f],
    Cases[Expand[f], Power[_, 1/2], 2]]][[1]]

NewEq[f] collects the parts with no square roots on one side of the equation, and the parts with square roots on the other side, squares both sides, then moves everything over to one side.
Code: Select all
NewEq[f_] := (NoRoots[f])^2 -  Expand[(Expand[f] - NoRoots[f])^2]

ExpandToratope applies NewEq over and over until no square roots remain.
Code: Select all
ExpandToratope[f_] :=
If[Count[Expand[f], Power[_, 1/2], 2] == 0, f,
  ExpandToratope[NewEq[f]]]

Example:
Code: Select all
In[82]:= tiger = (-a + Sqrt[x^2 + y^2])^2 + (-b + Sqrt[w^2 + z^2])^2;
ExpandToratope[tiger]

Out[83]= -64 a^2 b^2 w^2 x^2 - 64 a^2 b^2 w^2 y^2 -
64 a^2 b^2 x^2 z^2 -
64 a^2 b^2 y^2 z^2 + (a^4 + 2 a^2 b^2 + b^4 + 2 a^2 w^2 - 2 b^2 w^2 +
    w^4 - 2 a^2 x^2 + 2 b^2 x^2 + 2 w^2 x^2 + x^4 - 2 a^2 y^2 +
   2 b^2 y^2 + 2 w^2 y^2 + 2 x^2 y^2 + y^4 + 2 a^2 z^2 - 2 b^2 z^2 +
   2 w^2 z^2 + 2 x^2 z^2 + 2 y^2 z^2 + z^4)^2
User avatar
PWrong
Pentonian
 
Posts: 1599
Joined: Fri Jan 30, 2004 8:21 am
Location: Perth, Australia

Re: Polynomials for Toratopes

Postby ICN5D » Fri Oct 03, 2014 1:54 am

Wow, awesome! That there Mathematica is a useful program. Also, nice link to the square root stuff. It's a huge help.

One question: In the poly for a tiger, where is the third diameter, the minor one? Does it not need to be there?
It is by will alone, I set my donuts in motion
ICN5D
Pentonian
 
Posts: 1135
Joined: Mon Jul 28, 2008 4:25 am
Location: the Land of Flowers

Re: Polynomials for Toratopes

Postby PWrong » Fri Oct 03, 2014 2:47 am

Oh, I left it out thinking it wouldn't make a difference, but it does.

Code: Select all
In[87]:= FullSimplify[
ExpandToratope[
  Sqrt[(-a + Sqrt[x^2 + y^2])^2 + (-b + Sqrt[w^2 + z^2])^2] - R]]

Out[87]= -64 a^2 b^2 w^2 x^2 - 64 a^2 b^2 w^2 y^2 - 64 a^2 b^2 x^2 z^2 -  64 a^2 b^2 y^2 z^2
+ (a^4 + b^4 + 2 a^2 (b^2 - R^2 + w^2 - x^2 - y^2 + z^2) -
   2 b^2 (R^2 + w^2 - x^2 - y^2 + z^2) + (-R^2 + w^2 + x^2 + y^2 + z^2)^2)^2
User avatar
PWrong
Pentonian
 
Posts: 1599
Joined: Fri Jan 30, 2004 8:21 am
Location: Perth, Australia

Re: Polynomials for Toratopes

Postby ICN5D » Fri Oct 03, 2014 9:56 pm

There it is. The degree 8 polynomial for a tiger. Very cool! It takes on an interesting form, as polynomials within polynomials. Thats probably the combinatorics playing its part. I also imagine that it has a few levels of symmetric subgroups, too. Nice work.
It is by will alone, I set my donuts in motion
ICN5D
Pentonian
 
Posts: 1135
Joined: Mon Jul 28, 2008 4:25 am
Location: the Land of Flowers

Re: Polynomials for Toratopes

Postby Marek14 » Sat Oct 04, 2014 5:22 am

ICN5D wrote:There it is. The degree 8 polynomial for a tiger. Very cool! It takes on an interesting form, as polynomials within polynomials. Thats probably the combinatorics playing its part. I also imagine that it has a few levels of symmetric subgroups, too. Nice work.


Mathematica won't simplify it further, but the first part could be simplified to -64 a^2 b^2 (x^2 z^2 + y^2 z^2 + x^2 w^2 + y^2 w^2).
Marek14
Pentonian
 
Posts: 1191
Joined: Sat Jul 16, 2005 6:40 pm

Re: Polynomials for Toratopes

Postby PWrong » Sat Oct 04, 2014 6:47 am

We can simplify it some more:

-64 a^2 b^2 ( x^2 + y^2) ( z^2 + w^2) + ((a^2 + b^2)^2 - 2 (a^2 + b^2) R^2 + 2 (b^2 - a^2) (x^2 + y^2 - z^2 - w^2) + (-R^2 + x^2 + y^2 + z^2 + w^2)^2)^2

Some substitutions (e.g. p^2 = x^2 + y^2, q^2 = z^2 + w^2) might make the patterns clearer, if there are any.
User avatar
PWrong
Pentonian
 
Posts: 1599
Joined: Fri Jan 30, 2004 8:21 am
Location: Perth, Australia

Re: Polynomials for Toratopes

Postby Marek14 » Sat Oct 04, 2014 9:42 am

PWrong wrote:We can simplify it some more:

-64 a^2 b^2 ( x^2 + y^2) ( z^2 + w^2) + ((a^2 + b^2)^2 - 2 (a^2 + b^2) R^2 + 2 (b^2 - a^2) (x^2 + y^2 - z^2 - w^2) + (-R^2 + x^2 + y^2 + z^2 + w^2)^2)^2

Some substitutions (e.g. p^2 = x^2 + y^2, q^2 = z^2 + w^2) might make the patterns clearer, if there are any.


Now that looks interesting! How many people can say they studied degree-8 polynomials in 4 dimensions? :)
Marek14
Pentonian
 
Posts: 1191
Joined: Sat Jul 16, 2005 6:40 pm

Re: Polynomials for Toratopes

Postby ICN5D » Sat Oct 04, 2014 4:20 pm

Not many, I suspect. Making this even more awesome! How about ditorus? And, why not 5D , ((((II)I)I)I) , (((II)(II))I) , and (((II)I)(II)) ? I guess I'll need to be purchasing some Mathematica here, soon. This is great stuff, exactly what I was looking for. Then begins the process of root finding methods. All of these enormous polynomials have perfect and exact roots.
It is by will alone, I set my donuts in motion
ICN5D
Pentonian
 
Posts: 1135
Joined: Mon Jul 28, 2008 4:25 am
Location: the Land of Flowers

Re: Polynomials for Toratopes

Postby ICN5D » Sun Oct 05, 2014 4:45 am

In nice-looking LaTeX:

Image
It is by will alone, I set my donuts in motion
ICN5D
Pentonian
 
Posts: 1135
Joined: Mon Jul 28, 2008 4:25 am
Location: the Land of Flowers

Re: Polynomials for Toratopes

Postby PWrong » Sun Oct 05, 2014 12:08 pm

What do you mean by perfect and exact roots now?
User avatar
PWrong
Pentonian
 
Posts: 1599
Joined: Fri Jan 30, 2004 8:21 am
Location: Perth, Australia

Re: Polynomials for Toratopes

Postby ICN5D » Sun Oct 05, 2014 11:59 pm

Oh, I meant to say solutions. Maybe they are the same thing? Basically, it's the intercepts, in polynomial form. A torus can intercept as two circles, which are solutions of the quartic polynomial, if solving for a 2D plane. Someway, somehow, that complex quartic equation will make two quadratic equations of circles in plane XY or XZ. Those quadratics will be two copies of a circle, which are spaced apart by the value of a cut open diameter. It's like solving for x-intercepts of a parabola. At most, you can get two solutions, represented simply as (x+a)(x-a). But, we're starting with a degree-4 poly and trying to get two exactly matching degree-2's for the circles.

Full quartic for 3D torus:

(x^2 + y^2 + z^2 + R^2 - r^2)^2 - 4R^2*(x^2 + y^2)

Full quadratic for 2D circle:

x^2 + y^2 - r^2 = 0



Torus Intercepts in 2D ( XY or XZ solutions):

(x^2 + y^2 - (R-r)^2)*(x^2 + y^2 - (R+r)^2)) ---> concentric circles, differing in diameter by R-r , R+r

and

((x-R)^2 + z^2 - r^2)*((x+R)^2 + z^2 - r^2) ---> side by side circles, spaced along x by +R , -R


Torus Intercepts in 1D ( x-axis ):

(x - R + r)*(x - R - r)*(x + R - r)*(x + R + r) --> four points spaced apart by a combo of both diameters +/-

In solving for x, a torus has four simultaneous solutions. They can be all real, all complex, or half real, half complex. Same case with any N-2 dimensional intercept: we get empty cuts (complex) as possible solutions.



I have a few ideas, as to going about a root-finding algorithm, if none exists. One could multiply together and expand the solutions of two circles, and compare the diff between the expanded quartic for a torus. The two circles will make a quartic itself, but it won't be a complete torus, just the intercept. Another way, was to use your new code to expand the implicit function of a 2D equation for the circles, from the 3D torus:


(sqrt(x^2 + y^2) - R)^2 + z^2 - r^2 = 0 ---> 3D torus


(sqrt(x^2) - R)^2 + z^2 - r^2 = 0 --> side by side circles


(sqrt(x^2 + y^2) - R)^2 - r^2 = 0 --> concentric circles

The above implicits may give the proper form listed above, when expanded. But, the real task is how to do it with the quartic polynomial!

Then of course, the difficulty increases majorly, when working with the degree-8 for ditorus or tiger. Solving for any 3D plane will simplify into two perfect copies of a quartic equation for a torus. They would differ exactly according to a cut open diameter. From what I've read, root-finding algorithms can be more of an approximation of intercepts. But, these toratopes make exact intercepts, containing all terms from the parent polynomial (of the full shape), minus the dimension(s). When I started thinking about this, I got very curious about that process.

It sounds insanely complex, but maybe the symmetric subgroups make it easier. Those polynomials have many equal forms, like the two quartics for a torus. Maybe, through a process of restructuring them, the lower-degree polys become more clear, in how the shape intercepts, and makes these solutions. Am I on the right track with this? Does it seem right?
It is by will alone, I set my donuts in motion
ICN5D
Pentonian
 
Posts: 1135
Joined: Mon Jul 28, 2008 4:25 am
Location: the Land of Flowers

Re: Polynomials for Toratopes

Postby PWrong » Mon Oct 06, 2014 5:53 am

I don't think I completely follow what you're trying to do, or why it's so difficult.

To get a cut, you just set one of the variables to zero, right? And that gives you a new polynomial with fewer variables. So for the tiger,
sqrt( (sqrt(x^2 + y^2) - a)^2 + (sqrt(z^2 + w^2) - b)^2) - R = 0.
Looking at the w=0 hyperplane,
(sqrt(x^2 + y^2) - a)^2 + (|z| - b)^2 = R^2

This is a pair of torii. Set any other variable to 0 and you still get a pair of torii.

When you talk about "solutions" to the polynomial, do you mean set all the variables but one to 0 and then solve for the remaining variable? It's easier to do that with the original equation, rather than the expanded polynomial.

(|x| - a)^2 + b^2 = R^2,

(x + a + sqrt(R^2 - b^2))(x + a - sqrt(R^2 - b^2))(x - a + sqrt(R^2 - b^2))(x - a - sqrt(R^2 - b^2)) = 0

All the roots here are complex (assuming b > R as we usually do), which is what you'd expect since the tiger doesn't intersect the x axis, or any of the axes. But I don't see why this is interesting, it's just a trivial subset of the broader 4 variable polynomial.
User avatar
PWrong
Pentonian
 
Posts: 1599
Joined: Fri Jan 30, 2004 8:21 am
Location: Perth, Australia

Re: Polynomials for Toratopes

Postby ICN5D » Tue Oct 07, 2014 1:15 am

I might be using the wrong word for it. My idea is to use an algebraic approach to deriving intercepts, in the fully expanded polynomial form. Keeping it in implicit form is very easy, no doubt! I was curious in exploring the polynomials a little deeper, and deriving the number, type, and arrangement of intercept toratopes there would be. Trivial of course, since we can easily do it with the implicit. I like new challenges, if it actually is one!
It is by will alone, I set my donuts in motion
ICN5D
Pentonian
 
Posts: 1135
Joined: Mon Jul 28, 2008 4:25 am
Location: the Land of Flowers

Re: Polynomials for Toratopes

Postby Marek14 » Tue Oct 07, 2014 6:51 am

ICN5D wrote:I might be using the wrong word for it. My idea is to use an algebraic approach to deriving intercepts, in the fully expanded polynomial form. Keeping it in implicit form is very easy, no doubt! I was curious in exploring the polynomials a little deeper, and deriving the number, type, and arrangement of intercept toratopes there would be. Trivial of course, since we can easily do it with the implicit. I like new challenges, if it actually is one!


The fun part is that if you set any of the four coordinate variables in tiger equation to zero, you have to get something that can be decomposed to product of two full equations of toruses shifted in another axis. That's a bpretty fun property.
Marek14
Pentonian
 
Posts: 1191
Joined: Sat Jul 16, 2005 6:40 pm

Re: Polynomials for Toratopes

Postby PWrong » Tue Oct 07, 2014 2:30 pm

This isn't really related, but I was curious about the "complex" aspect of this and I decided to look at what these equations look like if all the variables are complex. To keep things simple I just looked at a circle, and it's actually really strange and interesting.

So the equation is just p^2 + q^2 = 1, where x and y are complex numbers.
(x + y i)^2 + (z + w i)^2 = 1

Expanding this out, we get two equations:
x^2 + z^2 - y^2 - w^2 = 1
x y + z w = 1

So this "complex circle" is actually a weird intersection of two four dimensional hyperbolic surfaces that I'm not very familiar with.
User avatar
PWrong
Pentonian
 
Posts: 1599
Joined: Fri Jan 30, 2004 8:21 am
Location: Perth, Australia

Re: Polynomials for Toratopes

Postby Marek14 » Tue Oct 07, 2014 4:35 pm

PWrong wrote:This isn't really related, but I was curious about the "complex" aspect of this and I decided to look at what these equations look like if all the variables are complex. To keep things simple I just looked at a circle, and it's actually really strange and interesting.

So the equation is just p^2 + q^2 = 1, where x and y are complex numbers.
(x + y i)^2 + (z + w i)^2 = 1

Expanding this out, we get two equations:
x^2 + z^2 - y^2 - w^2 = 1
x y + z w = 1

So this "complex circle" is actually a weird intersection of two four dimensional hyperbolic surfaces that I'm not very familiar with.


First of all, you have a mistake there -- if you expand the equation to read (x + y i)^2 + (z + w i)^2 = 1 + 0i, you'll see that the second equation (imaginary part) should be x y + z w = 0.

The first equation, x^2 + z^2 - y^2 - w^2 = 1, is one of the three types of 4D hyperboloids. While x^2 + y^2 + z^2 - w^2 = 1 is an obvious analogue of one-sheet hyperboloid and x^2 + y^2 + z^2 - w^2 = -1 is an obvious analogue of two-sheet hyperboloid, this third type is more interesting, since two of its cuts are one-sheet and two are two-sheet.

Slicing it in x direction will give you an equation z^2 - y^2 - w^2 = (1 - x^2). For |x| < 1, the slice will be a two-sheet hyperboloid, and as x grows to 1, the halves will come closer until the slice with |x| = 1, which is a cone. After that, the slices are one-sheet hyperboloids.
If you slice it in the y direction, you get x^2 + z^2 - w^2 = (1 + y^2). Here, all slices are one-sheet hyperboloids.

And if you do y/w-cut, you'll end up with x^2 + y^2 = 1, a circle. If we use y and w as parameters, we'll end up with x^2 + z^2 = (1 + y^2 + w^2), meaning that the radius of the circle increases with the distance from the "cut origin"

How about x y + z w = 0?
First of all, if we put y = 0 and w = 0, we get 0 = 0, meaning that all points of the xz plane are part of the figure. This explains why its intersection with the first equation in xz plane is the circle.
Similarly, we can deduce that four coordinate planes, xz, xw, yz and yw are all part of the figure.

We can turn this figure 45 degrees in xy plane and 45 degrees in zw plane:
(x*sqrt(2)/2 + y*sqrt(2)/2) (x*sqrt(2)/2 - y*sqrt(2)/2) + (z*sqrt(2)/2 + w*sqrt(2)/2) (z*sqrt(2)/2 - w*sqrt(2)/2) = 0
1/2(x^2 + z^2 - y^2 - w^2) = 0
x^2 + z^2 - y^2 - w^2 = 0

This is one of the two kinds of 4D cones, the other being x^2 + y^2 + z^2 - w^2 = 0.
Marek14
Pentonian
 
Posts: 1191
Joined: Sat Jul 16, 2005 6:40 pm

Next

Return to Toratopes

Who is online

Users browsing this forum: No registered users and 3 guests

cron