Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
question for increase the speed of solve syntax

Subject: question for increase the speed of solve syntax

From: mahdi roozbhani

Date: 30 Dec, 2010 08:52:04

Message: 1 of 4

matlab calculates the below code in very long time. Do u have any idea for decreasing the time's implementation of this code ?


secondsolve=solve('(x20-x10)^2+(y20-y10)^2+(znn-z10)^2=4','(x20-x30)^2+(y20-y30)^2+(znn-z30)^2=4','-slope*x20+y20=0','znn','x20','y20');

Subject: question for increase the speed of solve syntax

From: Walter Roberson

Date: 30 Dec, 2010 10:13:07

Message: 2 of 4

On 30/12/10 2:52 AM, mahdi roozbhani wrote:
> matlab calculates the below code in very long time. Do u have any idea
> for decreasing the time's implementation of this code ?
>
>
> secondsolve=solve('(x20-x10)^2+(y20-y10)^2+(znn-z10)^2=4','(x20-x30)^2+(y20-y30)^2+(znn-z30)^2=4','-slope*x20+y20=0','znn','x20','y20');

In Maple, the solve() takes less than 3 seconds, the majority of which
is probably formatting the output for fancy display. It is a long and
basically incomprehensible output. The more specific values you can fill
in via subs() before you do the solve, the more comprehensible the
output is likely to be.

After working to simplify the output, it comes out as:

[[[znn = (1/2) * ((-2 * z30 * y10 * y30 - 2 * z10 * y30 * y10 + y30^2 *
z10 + x30^2 * z30 - x30^2 * z10 + y30^2 * z30 - z30 * x10^2 + z30 *
y10^2 - z30 * z10^2 + z30^3 + x10^2 * z10 + y10^2 * z10 + z10^3 - z30^2
* z10) * slope^2 + (-2 * z30 * x10 * y30 - 2 * z30 * y10 * x30 + 4 * z10
* x30 * y30 - 2 * z10 * y30 * x10 + 4 * z30 * x10 * y10 - 2 * z10 * x30
* y10) * slope - z30^2 * z10 + z30 * x10^2 - z30 * y10^2 - z30 * z10^2 +
z30^3 + x10^2 * z10 + y10^2 * z10 - 2 * z30 * x10 * x30 - y30^2 * z10 +
z10^3 + x30^2 * z10 + y30^2 * z30 - 2 * z10 * x30 * x10 + x30^2 * z30 +
(-(-y30 + y10)^2 * (8 * y30 * y10 * z10 * z30 - 4 * y30 * y10 * x30^2 -
4 * y10 * y30 * z10^2 - 4 * y10 * y30 * x10^2 - 4 * y30 * y10 * z30^2 +
x30^4 + y30^4 + z30^4 + x10^4 + y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2 *
x30^2 * z10^2 + 2 * y30^2 * z30^2 + 2 * y30^2 * x10^2 + 6 * y30^2 *
y10^2 + 2 * y30^2 * z10^2 + 2 * z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 *
z30^2 * z10^2 + 2 * x10^2 * y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 *
z10^2 - 16 * y10^2 - 16 * z10^2 - 16 * y30^2 - 16 * z30^2 - 4 * y30^2 *
z30 * z10 - 4 * z30 * y10^2 * z10 + 32 * z30 * z10 - 4 * y30 * y10^3 +
32 * y30 * y10 - 4 * z30 * z10 * x10^2 - 4 * z30 * z10 * x30^2 - 4 * y10
* y30^3 + 2 * x30^2 * y30^2 + 2 * x30^2 * z30^2 - 2 * x30^2 * x10^2 - 4
* z30^3 * z10 - 4 * z10^3 * z30) * slope^4 + (-2 * (x10 - x30) * (-y30 +
y10) * (8 * y30 * y10 * z10 * z30 - 4 * y30 * y10 * x30^2 - 4 * y10 *
y30 * z10^2 - 4 * y10 * y30 * x10^2 - 4 * y30 * y10 * z30^2 + x30^4 +
y30^4 + z30^4 + x10^4 + y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2 * x30^2 *
z10^2 + 2 * y30^2 * z30^2 + 2 * y30^2 * x10^2 + 6 * y30^2 * y10^2 + 2 *
y30^2 * z10^2 + 2 * z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 * z30^2 *
z10^2 + 2 * x10^2 * y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 * z10^2 - 16 *
y10^2 - 16 * z10^2 - 16 * y30^2 - 16 * z30^2 - 4 * y30^2 * z30 * z10 - 4
* z30 * y10^2 * z10 + 32 * z30 * z10 - 4 * y30 * y10^3 + 32 * y30 * y10
- 4 * z30 * z10 * x10^2 - 4 * z30 * z10 * x30^2 - 4 * y10 * y30^3 + 2 *
x30^2 * y30^2 + 2 * x30^2 * z30^2 - 2 * x30^2 * x10^2 - 4 * z30^3 * z10
- 4 * z10^3 * z30) - (-y30 + y10)^2 * (-4 * y10 * x30 * x10^2 - 4 * x10
* y30^3 - 4 * y30 * x10 * x30^2 + 8 * y10 * x10 * x30^2 + 32 * x30 * y10
- 4 * x30 * y10 * y30^2 - 4 * y30 * x10 * z30^2 - 4 * x30 * y10 * z30^2
+ 8 * y30 * x30 * x10^2 - 32 * y30 * x30 - 4 * x10 * y30 * z10^2 - 4 *
y10 * x30 * z10^2 - 4 * x10 * y30 * y10^2 - 32 * y10 * x10 - 4 * x30 *
y10^3 + 8 * y10 * x10 * y30^2 + 8 * x30 * y10 * z10 * z30 + 32 * y30 *
x10 - 4 * y10 * x30^3 + 8 * y30 * x30 * y10^2 - 4 * y30 * x10^3 + 8 *
y30 * x10 * z10 * z30)) * slope^3 + (-(x10 - x30)^2 * (8 * y30 * y10 *
z10 * z30 - 4 * y30 * y10 * x30^2 - 4 * y10 * y30 * z10^2 - 4 * y10 *
y30 * x10^2 - 4 * y30 * y10 * z30^2 + x30^4 + y30^4 + z30^4 + x10^4 +
y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2 * x30^2 * z10^2 + 2 * y30^2 *
z30^2 + 2 * y30^2 * x10^2 + 6 * y30^2 * y10^2 + 2 * y30^2 * z10^2 + 2 *
z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 * z30^2 * z10^2 + 2 * x10^2 *
y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 * z10^2 - 16 * y10^2 - 16 * z10^2
- 16 * y30^2 - 16 * z30^2 - 4 * y30^2 * z30 * z10 - 4 * z30 * y10^2 *
z10 + 32 * z30 * z10 - 4 * y30 * y10^3 + 32 * y30 * y10 - 4 * z30 * z10
* x10^2 - 4 * z30 * z10 * x30^2 - 4 * y10 * y30^3 + 2 * x30^2 * y30^2 +
2 * x30^2 * z30^2 - 2 * x30^2 * x10^2 - 4 * z30^3 * z10 - 4 * z10^3 *
z30) - 2 * (x10 - x30) * (-y30 + y10) * (-4 * y10 * x30 * x10^2 - 4 *
x10 * y30^3 - 4 * y30 * x10 * x30^2 + 8 * y10 * x10 * x30^2 + 32 * x30 *
y10 - 4 * x30 * y10 * y30^2 - 4 * y30 * x10 * z30^2 - 4 * x30 * y10 *
z30^2 + 8 * y30 * x30 * x10^2 - 32 * y30 * x30 - 4 * x10 * y30 * z10^2 -
4 * y10 * x30 * z10^2 - 4 * x10 * y30 * y10^2 - 32 * y10 * x10 - 4 * x30
* y10^3 + 8 * y10 * x10 * y30^2 + 8 * x30 * y10 * z10 * z30 + 32 * y30 *
x10 - 4 * y10 * x30^3 + 8 * y30 * x30 * y10^2 - 4 * y30 * x10^3 + 8 *
y30 * x10 * z10 * z30) - (-y30 + y10)^2 * (x30^4 + y30^4 + z30^4 + x10^4
+ y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2 * x30^2 * z10^2 + 2 * y30^2 *
z30^2 + 2 * y30^2 * x10^2 - 2 * y30^2 * y10^2 + 2 * y30^2 * z10^2 + 2 *
z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 * z30^2 * z10^2 + 2 * x10^2 *
y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 * z10^2 - 4 * x30^3 * x10 + 32 *
x10 * x30 - 4 * x10^3 * x30 + 8 * z30 * z10 * x10 * x30 - 16 * x10^2 -
16 * z10^2 - 16 * x30^2 - 16 * z30^2 - 4 * y30^2 * z30 * z10 - 4 * z30 *
y10^2 * z10 + 32 * z30 * z10 - 4 * z30 * z10 * x10^2 - 4 * z30 * z10 *
x30^2 + 2 * x30^2 * y30^2 + 2 * x30^2 * z30^2 + 6 * x30^2 * x10^2 - 4 *
z30^3 * z10 - 4 * z10^3 * z30 - 4 * y30^2 * x10 * x30 - 4 * z30^2 * x10
* x30 - 4 * y10^2 * x30 * x10 - 4 * z10^2 * x30 * x10)) * slope^2 +
(-(x10 - x30)^2 * (-4 * y10 * x30 * x10^2 - 4 * x10 * y30^3 - 4 * y30 *
x10 * x30^2 + 8 * y10 * x10 * x30^2 + 32 * x30 * y10 - 4 * x30 * y10 *
y30^2 - 4 * y30 * x10 * z30^2 - 4 * x30 * y10 * z30^2 + 8 * y30 * x30 *
x10^2 - 32 * y30 * x30 - 4 * x10 * y30 * z10^2 - 4 * y10 * x30 * z10^2 -
4 * x10 * y30 * y10^2 - 32 * y10 * x10 - 4 * x30 * y10^3 + 8 * y10 * x10
* y30^2 + 8 * x30 * y10 * z10 * z30 + 32 * y30 * x10 - 4 * y10 * x30^3 +
8 * y30 * x30 * y10^2 - 4 * y30 * x10^3 + 8 * y30 * x10 * z10 * z30) - 2
* (x10 - x30) * (-y30 + y10) * (x30^4 + y30^4 + z30^4 + x10^4 + y10^4 +
z10^4 + 2 * x30^2 * y10^2 + 2 * x30^2 * z10^2 + 2 * y30^2 * z30^2 + 2 *
y30^2 * x10^2 - 2 * y30^2 * y10^2 + 2 * y30^2 * z10^2 + 2 * z30^2 *
x10^2 + 2 * z30^2 * y10^2 + 6 * z30^2 * z10^2 + 2 * x10^2 * y10^2 + 2 *
x10^2 * z10^2 + 2 * y10^2 * z10^2 - 4 * x30^3 * x10 + 32 * x10 * x30 - 4
* x10^3 * x30 + 8 * z30 * z10 * x10 * x30 - 16 * x10^2 - 16 * z10^2 - 16
* x30^2 - 16 * z30^2 - 4 * y30^2 * z30 * z10 - 4 * z30 * y10^2 * z10 +
32 * z30 * z10 - 4 * z30 * z10 * x10^2 - 4 * z30 * z10 * x30^2 + 2 *
x30^2 * y30^2 + 2 * x30^2 * z30^2 + 6 * x30^2 * x10^2 - 4 * z30^3 * z10
- 4 * z10^3 * z30 - 4 * y30^2 * x10 * x30 - 4 * z30^2 * x10 * x30 - 4 *
y10^2 * x30 * x10 - 4 * z10^2 * x30 * x10)) * slope - (x10 - x30)^2 *
(x30^4 + y30^4 + z30^4 + x10^4 + y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2 *
x30^2 * z10^2 + 2 * y30^2 * z30^2 + 2 * y30^2 * x10^2 - 2 * y30^2 *
y10^2 + 2 * y30^2 * z10^2 + 2 * z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 *
z30^2 * z10^2 + 2 * x10^2 * y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 *
z10^2 - 4 * x30^3 * x10 + 32 * x10 * x30 - 4 * x10^3 * x30 + 8 * z30 *
z10 * x10 * x30 - 16 * x10^2 - 16 * z10^2 - 16 * x30^2 - 16 * z30^2 - 4
* y30^2 * z30 * z10 - 4 * z30 * y10^2 * z10 + 32 * z30 * z10 - 4 * z30 *
z10 * x10^2 - 4 * z30 * z10 * x30^2 + 2 * x30^2 * y30^2 + 2 * x30^2 *
z30^2 + 6 * x30^2 * x10^2 - 4 * z30^3 * z10 - 4 * z10^3 * z30 - 4 *
y30^2 * x10 * x30 - 4 * z30^2 * x10 * x30 - 4 * y10^2 * x30 * x10 - 4 *
z10^2 * x30 * x10))^(1/2))/((-2 * z30 * z10 - 2 * y30 * y10 + z30^2 +
z10^2 + y10^2 + y30^2) * slope^2 + (2 * y10 * x10 - 2 * y30 * x10 - 2 *
x30 * y10 + 2 * y30 * x30) * slope + z30^2 + z10^2 + x10^2 + x30^2 - 2 *
x10 * x30 - 2 * z30 * z10),

x20 = - (1/2) * ((-2 * y30^2 * z30 * z10 + 2 * y10 * y30 * x10^2 + 2 *
z30 * y10^2 * z10 + x30^2 * y10^2 + y30^2 * z30^2 - y30^2 * x10^2 -
z30^2 * y10^2 - x10^2 * y10^2 - y10^2 * z10^2 + y30^4 - 2 * y30 * y10 *
x30^2 - 2 * y10 * y30^3 + y30^2 * z10^2 + x30^2 * y30^2 - y10^4 + 2 *
y30 * y10^3) * slope^2 + (2 * y30^3 * x30 - 2 * y30 * x30 * y10^2 - 4 *
y30 * x30 * z10 * z30 + 2 * y30 * x30^3 - 2 * y30 * x10 * x30^2 + 4 *
y10 * x10 * z10 * z30 - 2 * y10 * x10^3 + 2 * y10 * x30 * x10^2 - 2 *
y10^3 * x10 + 2 * x30 * y10^3 - 2 * y30 * x30 * x10^2 + 2 * y30 * x30 *
z10^2 + 2 * y30 * x30 * z30^2 - 2 * y10 * x10 * z10^2 + 2 * x10 * y30 *
y10^2 - 2 * x10 * y30^3 + 2 * y10 * x10 * y30^2 - 2 * x30 * y10 * y30^2
+ 2 * y10 * x10 * x30^2 - 2 * y10 * x10 * z30^2 - 2 * y10 * x30^3 + 2 *
y30 * x10^3) * slope - x10^2 * z10^2 + 2 * y10^2 * x30 * x10 + z10 *
(-(-y30 + y10)^2 * (8 * y30 * y10 * z10 * z30 - 4 * y30 * y10 * x30^2 -
4 * y10 * y30 * z10^2 - 4 * y10 * y30 * x10^2 - 4 * y30 * y10 * z30^2 +
x30^4 + y30^4 + z30^4 + x10^4 + y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2 *
x30^2 * z10^2 + 2 * y30^2 * z30^2 + 2 * y30^2 * x10^2 + 6 * y30^2 *
y10^2 + 2 * y30^2 * z10^2 + 2 * z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 *
z30^2 * z10^2 + 2 * x10^2 * y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 *
z10^2 - 16 * y10^2 - 16 * z10^2 - 16 * y30^2 - 16 * z30^2 - 4 * y30^2 *
z30 * z10 - 4 * z30 * y10^2 * z10 + 32 * z30 * z10 - 4 * y30 * y10^3 +
32 * y30 * y10 - 4 * z30 * z10 * x10^2 - 4 * z30 * z10 * x30^2 - 4 * y10
* y30^3 + 2 * x30^2 * y30^2 + 2 * x30^2 * z30^2 - 2 * x30^2 * x10^2 - 4
* z30^3 * z10 - 4 * z10^3 * z30) * slope^4 + (-2 * (x10 - x30) * (-y30 +
y10) * (8 * y30 * y10 * z10 * z30 - 4 * y30 * y10 * x30^2 - 4 * y10 *
y30 * z10^2 - 4 * y10 * y30 * x10^2 - 4 * y30 * y10 * z30^2 + x30^4 +
y30^4 + z30^4 + x10^4 + y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2 * x30^2 *
z10^2 + 2 * y30^2 * z30^2 + 2 * y30^2 * x10^2 + 6 * y30^2 * y10^2 + 2 *
y30^2 * z10^2 + 2 * z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 * z30^2 *
z10^2 + 2 * x10^2 * y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 * z10^2 - 16 *
y10^2 - 16 * z10^2 - 16 * y30^2 - 16 * z30^2 - 4 * y30^2 * z30 * z10 - 4
* z30 * y10^2 * z10 + 32 * z30 * z10 - 4 * y30 * y10^3 + 32 * y30 * y10
- 4 * z30 * z10 * x10^2 - 4 * z30 * z10 * x30^2 - 4 * y10 * y30^3 + 2 *
x30^2 * y30^2 + 2 * x30^2 * z30^2 - 2 * x30^2 * x10^2 - 4 * z30^3 * z10
- 4 * z10^3 * z30) - (-y30 + y10)^2 * (-4 * y10 * x30 * x10^2 - 4 * x10
* y30^3 - 4 * y30 * x10 * x30^2 + 8 * y10 * x10 * x30^2 + 32 * x30 * y10
- 4 * x30 * y10 * y30^2 - 4 * y30 * x10 * z30^2 - 4 * x30 * y10 * z30^2
+ 8 * y30 * x30 * x10^2 - 32 * y30 * x30 - 4 * x10 * y30 * z10^2 - 4 *
y10 * x30 * z10^2 - 4 * x10 * y30 * y10^2 - 32 * y10 * x10 - 4 * x30 *
y10^3 + 8 * y10 * x10 * y30^2 + 8 * x30 * y10 * z10 * z30 + 32 * y30 *
x10 - 4 * y10 * x30^3 + 8 * y30 * x30 * y10^2 - 4 * y30 * x10^3 + 8 *
y30 * x10 * z10 * z30)) * slope^3 + (-(x10 - x30)^2 * (8 * y30 * y10 *
z10 * z30 - 4 * y30 * y10 * x30^2 - 4 * y10 * y30 * z10^2 - 4 * y10 *
y30 * x10^2 - 4 * y30 * y10 * z30^2 + x30^4 + y30^4 + z30^4 + x10^4 +
y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2 * x30^2 * z10^2 + 2 * y30^2 *
z30^2 + 2 * y30^2 * x10^2 + 6 * y30^2 * y10^2 + 2 * y30^2 * z10^2 + 2 *
z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 * z30^2 * z10^2 + 2 * x10^2 *
y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 * z10^2 - 16 * y10^2 - 16 * z10^2
- 16 * y30^2 - 16 * z30^2 - 4 * y30^2 * z30 * z10 - 4 * z30 * y10^2 *
z10 + 32 * z30 * z10 - 4 * y30 * y10^3 + 32 * y30 * y10 - 4 * z30 * z10
* x10^2 - 4 * z30 * z10 * x30^2 - 4 * y10 * y30^3 + 2 * x30^2 * y30^2 +
2 * x30^2 * z30^2 - 2 * x30^2 * x10^2 - 4 * z30^3 * z10 - 4 * z10^3 *
z30) - 2 * (x10 - x30) * (-y30 + y10) * (-4 * y10 * x30 * x10^2 - 4 *
x10 * y30^3 - 4 * y30 * x10 * x30^2 + 8 * y10 * x10 * x30^2 + 32 * x30 *
y10 - 4 * x30 * y10 * y30^2 - 4 * y30 * x10 * z30^2 - 4 * x30 * y10 *
z30^2 + 8 * y30 * x30 * x10^2 - 32 * y30 * x30 - 4 * x10 * y30 * z10^2 -
4 * y10 * x30 * z10^2 - 4 * x10 * y30 * y10^2 - 32 * y10 * x10 - 4 * x30
* y10^3 + 8 * y10 * x10 * y30^2 + 8 * x30 * y10 * z10 * z30 + 32 * y30 *
x10 - 4 * y10 * x30^3 + 8 * y30 * x30 * y10^2 - 4 * y30 * x10^3 + 8 *
y30 * x10 * z10 * z30) - (-y30 + y10)^2 * (x30^4 + y30^4 + z30^4 + x10^4
+ y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2 * x30^2 * z10^2 + 2 * y30^2 *
z30^2 + 2 * y30^2 * x10^2 - 2 * y30^2 * y10^2 + 2 * y30^2 * z10^2 + 2 *
z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 * z30^2 * z10^2 + 2 * x10^2 *
y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 * z10^2 - 4 * x30^3 * x10 + 32 *
x10 * x30 - 4 * x10^3 * x30 + 8 * z30 * z10 * x10 * x30 - 16 * x10^2 -
16 * z10^2 - 16 * x30^2 - 16 * z30^2 - 4 * y30^2 * z30 * z10 - 4 * z30 *
y10^2 * z10 + 32 * z30 * z10 - 4 * z30 * z10 * x10^2 - 4 * z30 * z10 *
x30^2 + 2 * x30^2 * y30^2 + 2 * x30^2 * z30^2 + 6 * x30^2 * x10^2 - 4 *
z30^3 * z10 - 4 * z10^3 * z30 - 4 * y30^2 * x10 * x30 - 4 * z30^2 * x10
* x30 - 4 * y10^2 * x30 * x10 - 4 * z10^2 * x30 * x10)) * slope^2 +
(-(x10 - x30)^2 * (-4 * y10 * x30 * x10^2 - 4 * x10 * y30^3 - 4 * y30 *
x10 * x30^2 + 8 * y10 * x10 * x30^2 + 32 * x30 * y10 - 4 * x30 * y10 *
y30^2 - 4 * y30 * x10 * z30^2 - 4 * x30 * y10 * z30^2 + 8 * y30 * x30 *
x10^2 - 32 * y30 * x30 - 4 * x10 * y30 * z10^2 - 4 * y10 * x30 * z10^2 -
4 * x10 * y30 * y10^2 - 32 * y10 * x10 - 4 * x30 * y10^3 + 8 * y10 * x10
* y30^2 + 8 * x30 * y10 * z10 * z30 + 32 * y30 * x10 - 4 * y10 * x30^3 +
8 * y30 * x30 * y10^2 - 4 * y30 * x10^3 + 8 * y30 * x10 * z10 * z30) - 2
* (x10 - x30) * (-y30 + y10) * (x30^4 + y30^4 + z30^4 + x10^4 + y10^4 +
z10^4 + 2 * x30^2 * y10^2 + 2 * x30^2 * z10^2 + 2 * y30^2 * z30^2 + 2 *
y30^2 * x10^2 - 2 * y30^2 * y10^2 + 2 * y30^2 * z10^2 + 2 * z30^2 *
x10^2 + 2 * z30^2 * y10^2 + 6 * z30^2 * z10^2 + 2 * x10^2 * y10^2 + 2 *
x10^2 * z10^2 + 2 * y10^2 * z10^2 - 4 * x30^3 * x10 + 32 * x10 * x30 - 4
* x10^3 * x30 + 8 * z30 * z10 * x10 * x30 - 16 * x10^2 - 16 * z10^2 - 16
* x30^2 - 16 * z30^2 - 4 * y30^2 * z30 * z10 - 4 * z30 * y10^2 * z10 +
32 * z30 * z10 - 4 * z30 * z10 * x10^2 - 4 * z30 * z10 * x30^2 + 2 *
x30^2 * y30^2 + 2 * x30^2 * z30^2 + 6 * x30^2 * x10^2 - 4 * z30^3 * z10
- 4 * z10^3 * z30 - 4 * y30^2 * x10 * x30 - 4 * z30^2 * x10 * x30 - 4 *
y10^2 * x30 * x10 - 4 * z10^2 * x30 * x10)) * slope - (x10 - x30)^2 *
(x30^4 + y30^4 + z30^4 + x10^4 + y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2 *
x30^2 * z10^2 + 2 * y30^2 * z30^2 + 2 * y30^2 * x10^2 - 2 * y30^2 *
y10^2 + 2 * y30^2 * z10^2 + 2 * z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 *
z30^2 * z10^2 + 2 * x10^2 * y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 *
z10^2 - 4 * x30^3 * x10 + 32 * x10 * x30 - 4 * x10^3 * x30 + 8 * z30 *
z10 * x10 * x30 - 16 * x10^2 - 16 * z10^2 - 16 * x30^2 - 16 * z30^2 - 4
* y30^2 * z30 * z10 - 4 * z30 * y10^2 * z10 + 32 * z30 * z10 - 4 * z30 *
z10 * x10^2 - 4 * z30 * z10 * x30^2 + 2 * x30^2 * y30^2 + 2 * x30^2 *
z30^2 + 6 * x30^2 * x10^2 - 4 * z30^3 * z10 - 4 * z10^3 * z30 - 4 *
y30^2 * x10 * x30 - 4 * z30^2 * x10 * x30 - 4 * y10^2 * x30 * x10 - 4 *
z10^2 * x30 * x10))^(1/2) - z30 * (-(-y30 + y10)^2 * (8 * y30 * y10 *
z10 * z30 - 4 * y30 * y10 * x30^2 - 4 * y10 * y30 * z10^2 - 4 * y10 *
y30 * x10^2 - 4 * y30 * y10 * z30^2 + x30^4 + y30^4 + z30^4 + x10^4 +
y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2 * x30^2 * z10^2 + 2 * y30^2 *
z30^2 + 2 * y30^2 * x10^2 + 6 * y30^2 * y10^2 + 2 * y30^2 * z10^2 + 2 *
z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 * z30^2 * z10^2 + 2 * x10^2 *
y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 * z10^2 - 16 * y10^2 - 16 * z10^2
- 16 * y30^2 - 16 * z30^2 - 4 * y30^2 * z30 * z10 - 4 * z30 * y10^2 *
z10 + 32 * z30 * z10 - 4 * y30 * y10^3 + 32 * y30 * y10 - 4 * z30 * z10
* x10^2 - 4 * z30 * z10 * x30^2 - 4 * y10 * y30^3 + 2 * x30^2 * y30^2 +
2 * x30^2 * z30^2 - 2 * x30^2 * x10^2 - 4 * z30^3 * z10 - 4 * z10^3 *
z30) * slope^4 + (-2 * (x10 - x30) * (-y30 + y10) * (8 * y30 * y10 * z10
* z30 - 4 * y30 * y10 * x30^2 - 4 * y10 * y30 * z10^2 - 4 * y10 * y30 *
x10^2 - 4 * y30 * y10 * z30^2 + x30^4 + y30^4 + z30^4 + x10^4 + y10^4 +
z10^4 + 2 * x30^2 * y10^2 + 2 * x30^2 * z10^2 + 2 * y30^2 * z30^2 + 2 *
y30^2 * x10^2 + 6 * y30^2 * y10^2 + 2 * y30^2 * z10^2 + 2 * z30^2 *
x10^2 + 2 * z30^2 * y10^2 + 6 * z30^2 * z10^2 + 2 * x10^2 * y10^2 + 2 *
x10^2 * z10^2 + 2 * y10^2 * z10^2 - 16 * y10^2 - 16 * z10^2 - 16 * y30^2
- 16 * z30^2 - 4 * y30^2 * z30 * z10 - 4 * z30 * y10^2 * z10 + 32 * z30
* z10 - 4 * y30 * y10^3 + 32 * y30 * y10 - 4 * z30 * z10 * x10^2 - 4 *
z30 * z10 * x30^2 - 4 * y10 * y30^3 + 2 * x30^2 * y30^2 + 2 * x30^2 *
z30^2 - 2 * x30^2 * x10^2 - 4 * z30^3 * z10 - 4 * z10^3 * z30) - (-y30 +
y10)^2 * (-4 * y10 * x30 * x10^2 - 4 * x10 * y30^3 - 4 * y30 * x10 *
x30^2 + 8 * y10 * x10 * x30^2 + 32 * x30 * y10 - 4 * x30 * y10 * y30^2 -
4 * y30 * x10 * z30^2 - 4 * x30 * y10 * z30^2 + 8 * y30 * x30 * x10^2 -
32 * y30 * x30 - 4 * x10 * y30 * z10^2 - 4 * y10 * x30 * z10^2 - 4 * x10
* y30 * y10^2 - 32 * y10 * x10 - 4 * x30 * y10^3 + 8 * y10 * x10 * y30^2
+ 8 * x30 * y10 * z10 * z30 + 32 * y30 * x10 - 4 * y10 * x30^3 + 8 * y30
* x30 * y10^2 - 4 * y30 * x10^3 + 8 * y30 * x10 * z10 * z30)) * slope^3
+ (-(x10 - x30)^2 * (8 * y30 * y10 * z10 * z30 - 4 * y30 * y10 * x30^2 -
4 * y10 * y30 * z10^2 - 4 * y10 * y30 * x10^2 - 4 * y30 * y10 * z30^2 +
x30^4 + y30^4 + z30^4 + x10^4 + y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2 *
x30^2 * z10^2 + 2 * y30^2 * z30^2 + 2 * y30^2 * x10^2 + 6 * y30^2 *
y10^2 + 2 * y30^2 * z10^2 + 2 * z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 *
z30^2 * z10^2 + 2 * x10^2 * y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 *
z10^2 - 16 * y10^2 - 16 * z10^2 - 16 * y30^2 - 16 * z30^2 - 4 * y30^2 *
z30 * z10 - 4 * z30 * y10^2 * z10 + 32 * z30 * z10 - 4 * y30 * y10^3 +
32 * y30 * y10 - 4 * z30 * z10 * x10^2 - 4 * z30 * z10 * x30^2 - 4 * y10
* y30^3 + 2 * x30^2 * y30^2 + 2 * x30^2 * z30^2 - 2 * x30^2 * x10^2 - 4
* z30^3 * z10 - 4 * z10^3 * z30) - 2 * (x10 - x30) * (-y30 + y10) * (-4
* y10 * x30 * x10^2 - 4 * x10 * y30^3 - 4 * y30 * x10 * x30^2 + 8 * y10
* x10 * x30^2 + 32 * x30 * y10 - 4 * x30 * y10 * y30^2 - 4 * y30 * x10 *
z30^2 - 4 * x30 * y10 * z30^2 + 8 * y30 * x30 * x10^2 - 32 * y30 * x30 -
4 * x10 * y30 * z10^2 - 4 * y10 * x30 * z10^2 - 4 * x10 * y30 * y10^2 -
32 * y10 * x10 - 4 * x30 * y10^3 + 8 * y10 * x10 * y30^2 + 8 * x30 * y10
* z10 * z30 + 32 * y30 * x10 - 4 * y10 * x30^3 + 8 * y30 * x30 * y10^2 -
4 * y30 * x10^3 + 8 * y30 * x10 * z10 * z30) - (-y30 + y10)^2 * (x30^4 +
y30^4 + z30^4 + x10^4 + y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2 * x30^2 *
z10^2 + 2 * y30^2 * z30^2 + 2 * y30^2 * x10^2 - 2 * y30^2 * y10^2 + 2 *
y30^2 * z10^2 + 2 * z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 * z30^2 *
z10^2 + 2 * x10^2 * y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 * z10^2 - 4 *
x30^3 * x10 + 32 * x10 * x30 - 4 * x10^3 * x30 + 8 * z30 * z10 * x10 *
x30 - 16 * x10^2 - 16 * z10^2 - 16 * x30^2 - 16 * z30^2 - 4 * y30^2 *
z30 * z10 - 4 * z30 * y10^2 * z10 + 32 * z30 * z10 - 4 * z30 * z10 *
x10^2 - 4 * z30 * z10 * x30^2 + 2 * x30^2 * y30^2 + 2 * x30^2 * z30^2 +
6 * x30^2 * x10^2 - 4 * z30^3 * z10 - 4 * z10^3 * z30 - 4 * y30^2 * x10
* x30 - 4 * z30^2 * x10 * x30 - 4 * y10^2 * x30 * x10 - 4 * z10^2 * x30
* x10)) * slope^2 + (-(x10 - x30)^2 * (-4 * y10 * x30 * x10^2 - 4 * x10
* y30^3 - 4 * y30 * x10 * x30^2 + 8 * y10 * x10 * x30^2 + 32 * x30 * y10
- 4 * x30 * y10 * y30^2 - 4 * y30 * x10 * z30^2 - 4 * x30 * y10 * z30^2
+ 8 * y30 * x30 * x10^2 - 32 * y30 * x30 - 4 * x10 * y30 * z10^2 - 4 *
y10 * x30 * z10^2 - 4 * x10 * y30 * y10^2 - 32 * y10 * x10 - 4 * x30 *
y10^3 + 8 * y10 * x10 * y30^2 + 8 * x30 * y10 * z10 * z30 + 32 * y30 *
x10 - 4 * y10 * x30^3 + 8 * y30 * x30 * y10^2 - 4 * y30 * x10^3 + 8 *
y30 * x10 * z10 * z30) - 2 * (x10 - x30) * (-y30 + y10) * (x30^4 + y30^4
+ z30^4 + x10^4 + y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2 * x30^2 * z10^2
+ 2 * y30^2 * z30^2 + 2 * y30^2 * x10^2 - 2 * y30^2 * y10^2 + 2 * y30^2
* z10^2 + 2 * z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 * z30^2 * z10^2 + 2
* x10^2 * y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 * z10^2 - 4 * x30^3 *
x10 + 32 * x10 * x30 - 4 * x10^3 * x30 + 8 * z30 * z10 * x10 * x30 - 16
* x10^2 - 16 * z10^2 - 16 * x30^2 - 16 * z30^2 - 4 * y30^2 * z30 * z10 -
4 * z30 * y10^2 * z10 + 32 * z30 * z10 - 4 * z30 * z10 * x10^2 - 4 * z30
* z10 * x30^2 + 2 * x30^2 * y30^2 + 2 * x30^2 * z30^2 + 6 * x30^2 *
x10^2 - 4 * z30^3 * z10 - 4 * z10^3 * z30 - 4 * y30^2 * x10 * x30 - 4 *
z30^2 * x10 * x30 - 4 * y10^2 * x30 * x10 - 4 * z10^2 * x30 * x10)) *
slope - (x10 - x30)^2 * (x30^4 + y30^4 + z30^4 + x10^4 + y10^4 + z10^4 +
2 * x30^2 * y10^2 + 2 * x30^2 * z10^2 + 2 * y30^2 * z30^2 + 2 * y30^2 *
x10^2 - 2 * y30^2 * y10^2 + 2 * y30^2 * z10^2 + 2 * z30^2 * x10^2 + 2 *
z30^2 * y10^2 + 6 * z30^2 * z10^2 + 2 * x10^2 * y10^2 + 2 * x10^2 *
z10^2 + 2 * y10^2 * z10^2 - 4 * x30^3 * x10 + 32 * x10 * x30 - 4 * x10^3
* x30 + 8 * z30 * z10 * x10 * x30 - 16 * x10^2 - 16 * z10^2 - 16 * x30^2
- 16 * z30^2 - 4 * y30^2 * z30 * z10 - 4 * z30 * y10^2 * z10 + 32 * z30
* z10 - 4 * z30 * z10 * x10^2 - 4 * z30 * z10 * x30^2 + 2 * x30^2 *
y30^2 + 2 * x30^2 * z30^2 + 6 * x30^2 * x10^2 - 4 * z30^3 * z10 - 4 *
z10^3 * z30 - 4 * y30^2 * x10 * x30 - 4 * z30^2 * x10 * x30 - 4 * y10^2
* x30 * x10 - 4 * z10^2 * x30 * x10))^(1/2) + x30^2 * z10^2 + x30^4 -
x10^4 - x30^2 * y10^2 - x10^2 * y10^2 - 2 * y30^2 * x10 * x30 + y30^2 *
x10^2 - z30^2 * x10^2 + 2 * x10^3 * x30 + x30^2 * z30^2 - 2 * x30^3 *
x10 - 2 * z30 * z10 * x30^2 + x30^2 * y30^2 + 2 * z30 * z10 *
x10^2)/(((-2 * z30 * z10 - 2 * y30 * y10 + z30^2 + z10^2 + y10^2 +
y30^2) * slope^2 + (2 * y10 * x10 - 2 * y30 * x10 - 2 * x30 * y10 + 2 *
y30 * x30) * slope + z30^2 + z10^2 + x10^2 + x30^2 - 2 * x10 * x30 - 2 *
z30 * z10) * ((-y30 + y10) * slope + x10 - x30)),

y20 = - (1/2) * slope * ((-2 * y30^2 * z30 * z10 + 2 * y10 * y30 *
x10^2 + 2 * z30 * y10^2 * z10 + x30^2 * y10^2 + y30^2 * z30^2 - y30^2 *
x10^2 - z30^2 * y10^2 - x10^2 * y10^2 - y10^2 * z10^2 + y30^4 - 2 * y30
* y10 * x30^2 - 2 * y10 * y30^3 + y30^2 * z10^2 + x30^2 * y30^2 - y10^4
+ 2 * y30 * y10^3) * slope^2 + (2 * y30^3 * x30 - 2 * y30 * x30 * y10^2
- 4 * y30 * x30 * z10 * z30 + 2 * y30 * x30^3 - 2 * y30 * x10 * x30^2 +
4 * y10 * x10 * z10 * z30 - 2 * y10 * x10^3 + 2 * y10 * x30 * x10^2 - 2
* y10^3 * x10 + 2 * x30 * y10^3 - 2 * y30 * x30 * x10^2 + 2 * y30 * x30
* z10^2 + 2 * y30 * x30 * z30^2 - 2 * y10 * x10 * z10^2 + 2 * x10 * y30
* y10^2 - 2 * x10 * y30^3 + 2 * y10 * x10 * y30^2 - 2 * x30 * y10 *
y30^2 + 2 * y10 * x10 * x30^2 - 2 * y10 * x10 * z30^2 - 2 * y10 * x30^3
+ 2 * y30 * x10^3) * slope - x10^2 * z10^2 + 2 * y10^2 * x30 * x10 + z10
* (-(-y30 + y10)^2 * (8 * y30 * y10 * z10 * z30 - 4 * y30 * y10 * x30^2
- 4 * y10 * y30 * z10^2 - 4 * y10 * y30 * x10^2 - 4 * y30 * y10 * z30^2
+ x30^4 + y30^4 + z30^4 + x10^4 + y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2
* x30^2 * z10^2 + 2 * y30^2 * z30^2 + 2 * y30^2 * x10^2 + 6 * y30^2 *
y10^2 + 2 * y30^2 * z10^2 + 2 * z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 *
z30^2 * z10^2 + 2 * x10^2 * y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 *
z10^2 - 16 * y10^2 - 16 * z10^2 - 16 * y30^2 - 16 * z30^2 - 4 * y30^2 *
z30 * z10 - 4 * z30 * y10^2 * z10 + 32 * z30 * z10 - 4 * y30 * y10^3 +
32 * y30 * y10 - 4 * z30 * z10 * x10^2 - 4 * z30 * z10 * x30^2 - 4 * y10
* y30^3 + 2 * x30^2 * y30^2 + 2 * x30^2 * z30^2 - 2 * x30^2 * x10^2 - 4
* z30^3 * z10 - 4 * z10^3 * z30) * slope^4 + (-2 * (x10 - x30) * (-y30 +
y10) * (8 * y30 * y10 * z10 * z30 - 4 * y30 * y10 * x30^2 - 4 * y10 *
y30 * z10^2 - 4 * y10 * y30 * x10^2 - 4 * y30 * y10 * z30^2 + x30^4 +
y30^4 + z30^4 + x10^4 + y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2 * x30^2 *
z10^2 + 2 * y30^2 * z30^2 + 2 * y30^2 * x10^2 + 6 * y30^2 * y10^2 + 2 *
y30^2 * z10^2 + 2 * z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 * z30^2 *
z10^2 + 2 * x10^2 * y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 * z10^2 - 16 *
y10^2 - 16 * z10^2 - 16 * y30^2 - 16 * z30^2 - 4 * y30^2 * z30 * z10 - 4
* z30 * y10^2 * z10 + 32 * z30 * z10 - 4 * y30 * y10^3 + 32 * y30 * y10
- 4 * z30 * z10 * x10^2 - 4 * z30 * z10 * x30^2 - 4 * y10 * y30^3 + 2 *
x30^2 * y30^2 + 2 * x30^2 * z30^2 - 2 * x30^2 * x10^2 - 4 * z30^3 * z10
- 4 * z10^3 * z30) - (-y30 + y10)^2 * (-4 * y10 * x30 * x10^2 - 4 * x10
* y30^3 - 4 * y30 * x10 * x30^2 + 8 * y10 * x10 * x30^2 + 32 * x30 * y10
- 4 * x30 * y10 * y30^2 - 4 * y30 * x10 * z30^2 - 4 * x30 * y10 * z30^2
+ 8 * y30 * x30 * x10^2 - 32 * y30 * x30 - 4 * x10 * y30 * z10^2 - 4 *
y10 * x30 * z10^2 - 4 * x10 * y30 * y10^2 - 32 * y10 * x10 - 4 * x30 *
y10^3 + 8 * y10 * x10 * y30^2 + 8 * x30 * y10 * z10 * z30 + 32 * y30 *
x10 - 4 * y10 * x30^3 + 8 * y30 * x30 * y10^2 - 4 * y30 * x10^3 + 8 *
y30 * x10 * z10 * z30)) * slope^3 + (-(x10 - x30)^2 * (8 * y30 * y10 *
z10 * z30 - 4 * y30 * y10 * x30^2 - 4 * y10 * y30 * z10^2 - 4 * y10 *
y30 * x10^2 - 4 * y30 * y10 * z30^2 + x30^4 + y30^4 + z30^4 + x10^4 +
y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2 * x30^2 * z10^2 + 2 * y30^2 *
z30^2 + 2 * y30^2 * x10^2 + 6 * y30^2 * y10^2 + 2 * y30^2 * z10^2 + 2 *
z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 * z30^2 * z10^2 + 2 * x10^2 *
y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 * z10^2 - 16 * y10^2 - 16 * z10^2
- 16 * y30^2 - 16 * z30^2 - 4 * y30^2 * z30 * z10 - 4 * z30 * y10^2 *
z10 + 32 * z30 * z10 - 4 * y30 * y10^3 + 32 * y30 * y10 - 4 * z30 * z10
* x10^2 - 4 * z30 * z10 * x30^2 - 4 * y10 * y30^3 + 2 * x30^2 * y30^2 +
2 * x30^2 * z30^2 - 2 * x30^2 * x10^2 - 4 * z30^3 * z10 - 4 * z10^3 *
z30) - 2 * (x10 - x30) * (-y30 + y10) * (-4 * y10 * x30 * x10^2 - 4 *
x10 * y30^3 - 4 * y30 * x10 * x30^2 + 8 * y10 * x10 * x30^2 + 32 * x30 *
y10 - 4 * x30 * y10 * y30^2 - 4 * y30 * x10 * z30^2 - 4 * x30 * y10 *
z30^2 + 8 * y30 * x30 * x10^2 - 32 * y30 * x30 - 4 * x10 * y30 * z10^2 -
4 * y10 * x30 * z10^2 - 4 * x10 * y30 * y10^2 - 32 * y10 * x10 - 4 * x30
* y10^3 + 8 * y10 * x10 * y30^2 + 8 * x30 * y10 * z10 * z30 + 32 * y30 *
x10 - 4 * y10 * x30^3 + 8 * y30 * x30 * y10^2 - 4 * y30 * x10^3 + 8 *
y30 * x10 * z10 * z30) - (-y30 + y10)^2 * (x30^4 + y30^4 + z30^4 + x10^4
+ y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2 * x30^2 * z10^2 + 2 * y30^2 *
z30^2 + 2 * y30^2 * x10^2 - 2 * y30^2 * y10^2 + 2 * y30^2 * z10^2 + 2 *
z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 * z30^2 * z10^2 + 2 * x10^2 *
y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 * z10^2 - 4 * x30^3 * x10 + 32 *
x10 * x30 - 4 * x10^3 * x30 + 8 * z30 * z10 * x10 * x30 - 16 * x10^2 -
16 * z10^2 - 16 * x30^2 - 16 * z30^2 - 4 * y30^2 * z30 * z10 - 4 * z30 *
y10^2 * z10 + 32 * z30 * z10 - 4 * z30 * z10 * x10^2 - 4 * z30 * z10 *
x30^2 + 2 * x30^2 * y30^2 + 2 * x30^2 * z30^2 + 6 * x30^2 * x10^2 - 4 *
z30^3 * z10 - 4 * z10^3 * z30 - 4 * y30^2 * x10 * x30 - 4 * z30^2 * x10
* x30 - 4 * y10^2 * x30 * x10 - 4 * z10^2 * x30 * x10)) * slope^2 +
(-(x10 - x30)^2 * (-4 * y10 * x30 * x10^2 - 4 * x10 * y30^3 - 4 * y30 *
x10 * x30^2 + 8 * y10 * x10 * x30^2 + 32 * x30 * y10 - 4 * x30 * y10 *
y30^2 - 4 * y30 * x10 * z30^2 - 4 * x30 * y10 * z30^2 + 8 * y30 * x30 *
x10^2 - 32 * y30 * x30 - 4 * x10 * y30 * z10^2 - 4 * y10 * x30 * z10^2 -
4 * x10 * y30 * y10^2 - 32 * y10 * x10 - 4 * x30 * y10^3 + 8 * y10 * x10
* y30^2 + 8 * x30 * y10 * z10 * z30 + 32 * y30 * x10 - 4 * y10 * x30^3 +
8 * y30 * x30 * y10^2 - 4 * y30 * x10^3 + 8 * y30 * x10 * z10 * z30) - 2
* (x10 - x30) * (-y30 + y10) * (x30^4 + y30^4 + z30^4 + x10^4 + y10^4 +
z10^4 + 2 * x30^2 * y10^2 + 2 * x30^2 * z10^2 + 2 * y30^2 * z30^2 + 2 *
y30^2 * x10^2 - 2 * y30^2 * y10^2 + 2 * y30^2 * z10^2 + 2 * z30^2 *
x10^2 + 2 * z30^2 * y10^2 + 6 * z30^2 * z10^2 + 2 * x10^2 * y10^2 + 2 *
x10^2 * z10^2 + 2 * y10^2 * z10^2 - 4 * x30^3 * x10 + 32 * x10 * x30 - 4
* x10^3 * x30 + 8 * z30 * z10 * x10 * x30 - 16 * x10^2 - 16 * z10^2 - 16
* x30^2 - 16 * z30^2 - 4 * y30^2 * z30 * z10 - 4 * z30 * y10^2 * z10 +
32 * z30 * z10 - 4 * z30 * z10 * x10^2 - 4 * z30 * z10 * x30^2 + 2 *
x30^2 * y30^2 + 2 * x30^2 * z30^2 + 6 * x30^2 * x10^2 - 4 * z30^3 * z10
- 4 * z10^3 * z30 - 4 * y30^2 * x10 * x30 - 4 * z30^2 * x10 * x30 - 4 *
y10^2 * x30 * x10 - 4 * z10^2 * x30 * x10)) * slope - (x10 - x30)^2 *
(x30^4 + y30^4 + z30^4 + x10^4 + y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2 *
x30^2 * z10^2 + 2 * y30^2 * z30^2 + 2 * y30^2 * x10^2 - 2 * y30^2 *
y10^2 + 2 * y30^2 * z10^2 + 2 * z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 *
z30^2 * z10^2 + 2 * x10^2 * y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 *
z10^2 - 4 * x30^3 * x10 + 32 * x10 * x30 - 4 * x10^3 * x30 + 8 * z30 *
z10 * x10 * x30 - 16 * x10^2 - 16 * z10^2 - 16 * x30^2 - 16 * z30^2 - 4
* y30^2 * z30 * z10 - 4 * z30 * y10^2 * z10 + 32 * z30 * z10 - 4 * z30 *
z10 * x10^2 - 4 * z30 * z10 * x30^2 + 2 * x30^2 * y30^2 + 2 * x30^2 *
z30^2 + 6 * x30^2 * x10^2 - 4 * z30^3 * z10 - 4 * z10^3 * z30 - 4 *
y30^2 * x10 * x30 - 4 * z30^2 * x10 * x30 - 4 * y10^2 * x30 * x10 - 4 *
z10^2 * x30 * x10))^(1/2) - z30 * (-(-y30 + y10)^2 * (8 * y30 * y10 *
z10 * z30 - 4 * y30 * y10 * x30^2 - 4 * y10 * y30 * z10^2 - 4 * y10 *
y30 * x10^2 - 4 * y30 * y10 * z30^2 + x30^4 + y30^4 + z30^4 + x10^4 +
y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2 * x30^2 * z10^2 + 2 * y30^2 *
z30^2 + 2 * y30^2 * x10^2 + 6 * y30^2 * y10^2 + 2 * y30^2 * z10^2 + 2 *
z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 * z30^2 * z10^2 + 2 * x10^2 *
y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 * z10^2 - 16 * y10^2 - 16 * z10^2
- 16 * y30^2 - 16 * z30^2 - 4 * y30^2 * z30 * z10 - 4 * z30 * y10^2 *
z10 + 32 * z30 * z10 - 4 * y30 * y10^3 + 32 * y30 * y10 - 4 * z30 * z10
* x10^2 - 4 * z30 * z10 * x30^2 - 4 * y10 * y30^3 + 2 * x30^2 * y30^2 +
2 * x30^2 * z30^2 - 2 * x30^2 * x10^2 - 4 * z30^3 * z10 - 4 * z10^3 *
z30) * slope^4 + (-2 * (x10 - x30) * (-y30 + y10) * (8 * y30 * y10 * z10
* z30 - 4 * y30 * y10 * x30^2 - 4 * y10 * y30 * z10^2 - 4 * y10 * y30 *
x10^2 - 4 * y30 * y10 * z30^2 + x30^4 + y30^4 + z30^4 + x10^4 + y10^4 +
z10^4 + 2 * x30^2 * y10^2 + 2 * x30^2 * z10^2 + 2 * y30^2 * z30^2 + 2 *
y30^2 * x10^2 + 6 * y30^2 * y10^2 + 2 * y30^2 * z10^2 + 2 * z30^2 *
x10^2 + 2 * z30^2 * y10^2 + 6 * z30^2 * z10^2 + 2 * x10^2 * y10^2 + 2 *
x10^2 * z10^2 + 2 * y10^2 * z10^2 - 16 * y10^2 - 16 * z10^2 - 16 * y30^2
- 16 * z30^2 - 4 * y30^2 * z30 * z10 - 4 * z30 * y10^2 * z10 + 32 * z30
* z10 - 4 * y30 * y10^3 + 32 * y30 * y10 - 4 * z30 * z10 * x10^2 - 4 *
z30 * z10 * x30^2 - 4 * y10 * y30^3 + 2 * x30^2 * y30^2 + 2 * x30^2 *
z30^2 - 2 * x30^2 * x10^2 - 4 * z30^3 * z10 - 4 * z10^3 * z30) - (-y30 +
y10)^2 * (-4 * y10 * x30 * x10^2 - 4 * x10 * y30^3 - 4 * y30 * x10 *
x30^2 + 8 * y10 * x10 * x30^2 + 32 * x30 * y10 - 4 * x30 * y10 * y30^2 -
4 * y30 * x10 * z30^2 - 4 * x30 * y10 * z30^2 + 8 * y30 * x30 * x10^2 -
32 * y30 * x30 - 4 * x10 * y30 * z10^2 - 4 * y10 * x30 * z10^2 - 4 * x10
* y30 * y10^2 - 32 * y10 * x10 - 4 * x30 * y10^3 + 8 * y10 * x10 * y30^2
+ 8 * x30 * y10 * z10 * z30 + 32 * y30 * x10 - 4 * y10 * x30^3 + 8 * y30
* x30 * y10^2 - 4 * y30 * x10^3 + 8 * y30 * x10 * z10 * z30)) * slope^3
+ (-(x10 - x30)^2 * (8 * y30 * y10 * z10 * z30 - 4 * y30 * y10 * x30^2 -
4 * y10 * y30 * z10^2 - 4 * y10 * y30 * x10^2 - 4 * y30 * y10 * z30^2 +
x30^4 + y30^4 + z30^4 + x10^4 + y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2 *
x30^2 * z10^2 + 2 * y30^2 * z30^2 + 2 * y30^2 * x10^2 + 6 * y30^2 *
y10^2 + 2 * y30^2 * z10^2 + 2 * z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 *
z30^2 * z10^2 + 2 * x10^2 * y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 *
z10^2 - 16 * y10^2 - 16 * z10^2 - 16 * y30^2 - 16 * z30^2 - 4 * y30^2 *
z30 * z10 - 4 * z30 * y10^2 * z10 + 32 * z30 * z10 - 4 * y30 * y10^3 +
32 * y30 * y10 - 4 * z30 * z10 * x10^2 - 4 * z30 * z10 * x30^2 - 4 * y10
* y30^3 + 2 * x30^2 * y30^2 + 2 * x30^2 * z30^2 - 2 * x30^2 * x10^2 - 4
* z30^3 * z10 - 4 * z10^3 * z30) - 2 * (x10 - x30) * (-y30 + y10) * (-4
* y10 * x30 * x10^2 - 4 * x10 * y30^3 - 4 * y30 * x10 * x30^2 + 8 * y10
* x10 * x30^2 + 32 * x30 * y10 - 4 * x30 * y10 * y30^2 - 4 * y30 * x10 *
z30^2 - 4 * x30 * y10 * z30^2 + 8 * y30 * x30 * x10^2 - 32 * y30 * x30 -
4 * x10 * y30 * z10^2 - 4 * y10 * x30 * z10^2 - 4 * x10 * y30 * y10^2 -
32 * y10 * x10 - 4 * x30 * y10^3 + 8 * y10 * x10 * y30^2 + 8 * x30 * y10
* z10 * z30 + 32 * y30 * x10 - 4 * y10 * x30^3 + 8 * y30 * x30 * y10^2 -
4 * y30 * x10^3 + 8 * y30 * x10 * z10 * z30) - (-y30 + y10)^2 * (x30^4 +
y30^4 + z30^4 + x10^4 + y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2 * x30^2 *
z10^2 + 2 * y30^2 * z30^2 + 2 * y30^2 * x10^2 - 2 * y30^2 * y10^2 + 2 *
y30^2 * z10^2 + 2 * z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 * z30^2 *
z10^2 + 2 * x10^2 * y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 * z10^2 - 4 *
x30^3 * x10 + 32 * x10 * x30 - 4 * x10^3 * x30 + 8 * z30 * z10 * x10 *
x30 - 16 * x10^2 - 16 * z10^2 - 16 * x30^2 - 16 * z30^2 - 4 * y30^2 *
z30 * z10 - 4 * z30 * y10^2 * z10 + 32 * z30 * z10 - 4 * z30 * z10 *
x10^2 - 4 * z30 * z10 * x30^2 + 2 * x30^2 * y30^2 + 2 * x30^2 * z30^2 +
6 * x30^2 * x10^2 - 4 * z30^3 * z10 - 4 * z10^3 * z30 - 4 * y30^2 * x10
* x30 - 4 * z30^2 * x10 * x30 - 4 * y10^2 * x30 * x10 - 4 * z10^2 * x30
* x10)) * slope^2 + (-(x10 - x30)^2 * (-4 * y10 * x30 * x10^2 - 4 * x10
* y30^3 - 4 * y30 * x10 * x30^2 + 8 * y10 * x10 * x30^2 + 32 * x30 * y10
- 4 * x30 * y10 * y30^2 - 4 * y30 * x10 * z30^2 - 4 * x30 * y10 * z30^2
+ 8 * y30 * x30 * x10^2 - 32 * y30 * x30 - 4 * x10 * y30 * z10^2 - 4 *
y10 * x30 * z10^2 - 4 * x10 * y30 * y10^2 - 32 * y10 * x10 - 4 * x30 *
y10^3 + 8 * y10 * x10 * y30^2 + 8 * x30 * y10 * z10 * z30 + 32 * y30 *
x10 - 4 * y10 * x30^3 + 8 * y30 * x30 * y10^2 - 4 * y30 * x10^3 + 8 *
y30 * x10 * z10 * z30) - 2 * (x10 - x30) * (-y30 + y10) * (x30^4 + y30^4
+ z30^4 + x10^4 + y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2 * x30^2 * z10^2
+ 2 * y30^2 * z30^2 + 2 * y30^2 * x10^2 - 2 * y30^2 * y10^2 + 2 * y30^2
* z10^2 + 2 * z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 * z30^2 * z10^2 + 2
* x10^2 * y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 * z10^2 - 4 * x30^3 *
x10 + 32 * x10 * x30 - 4 * x10^3 * x30 + 8 * z30 * z10 * x10 * x30 - 16
* x10^2 - 16 * z10^2 - 16 * x30^2 - 16 * z30^2 - 4 * y30^2 * z30 * z10 -
4 * z30 * y10^2 * z10 + 32 * z30 * z10 - 4 * z30 * z10 * x10^2 - 4 * z30
* z10 * x30^2 + 2 * x30^2 * y30^2 + 2 * x30^2 * z30^2 + 6 * x30^2 *
x10^2 - 4 * z30^3 * z10 - 4 * z10^3 * z30 - 4 * y30^2 * x10 * x30 - 4 *
z30^2 * x10 * x30 - 4 * y10^2 * x30 * x10 - 4 * z10^2 * x30 * x10)) *
slope - (x10 - x30)^2 * (x30^4 + y30^4 + z30^4 + x10^4 + y10^4 + z10^4 +
2 * x30^2 * y10^2 + 2 * x30^2 * z10^2 + 2 * y30^2 * z30^2 + 2 * y30^2 *
x10^2 - 2 * y30^2 * y10^2 + 2 * y30^2 * z10^2 + 2 * z30^2 * x10^2 + 2 *
z30^2 * y10^2 + 6 * z30^2 * z10^2 + 2 * x10^2 * y10^2 + 2 * x10^2 *
z10^2 + 2 * y10^2 * z10^2 - 4 * x30^3 * x10 + 32 * x10 * x30 - 4 * x10^3
* x30 + 8 * z30 * z10 * x10 * x30 - 16 * x10^2 - 16 * z10^2 - 16 * x30^2
- 16 * z30^2 - 4 * y30^2 * z30 * z10 - 4 * z30 * y10^2 * z10 + 32 * z30
* z10 - 4 * z30 * z10 * x10^2 - 4 * z30 * z10 * x30^2 + 2 * x30^2 *
y30^2 + 2 * x30^2 * z30^2 + 6 * x30^2 * x10^2 - 4 * z30^3 * z10 - 4 *
z10^3 * z30 - 4 * y30^2 * x10 * x30 - 4 * z30^2 * x10 * x30 - 4 * y10^2
* x30 * x10 - 4 * z10^2 * x30 * x10))^(1/2) + x30^2 * z10^2 + x30^4 -
x10^4 - x30^2 * y10^2 - x10^2 * y10^2 - 2 * y30^2 * x10 * x30 + y30^2 *
x10^2 - z30^2 * x10^2 + 2 * x10^3 * x30 + x30^2 * z30^2 - 2 * x30^3 *
x10 - 2 * z30 * z10 * x30^2 + x30^2 * y30^2 + 2 * z30 * z10 *
x10^2)/(((-2 * z30 * z10 - 2 * y30 * y10 + z30^2 + z10^2 + y10^2 +
y30^2) * slope^2 + (2 * y10 * x10 - 2 * y30 * x10 - 2 * x30 * y10 + 2 *
y30 * x30) * slope + z30^2 + z10^2 + x10^2 + x30^2 - 2 * x10 * x30 - 2 *
z30 * z10) * ((-y30 + y10) * slope + x10 - x30))]],

[[znn = - (1/2) * ((2 * z30 * y10 * y30 + 2 * z10 * y30 * y10 - y30^2 *
z10 - x30^2 * z30 + x30^2 * z10 - y30^2 * z30 + z30 * x10^2 - z30 *
y10^2 + z30 * z10^2 - z30^3 - x10^2 * z10 - y10^2 * z10 - z10^3 + z30^2
* z10) * slope^2 + (2 * z30 * x10 * y30 + 2 * z30 * y10 * x30 - 4 * z10
* x30 * y30 + 2 * z10 * y30 * x10 - 4 * z30 * x10 * y10 + 2 * z10 * x30
* y10) * slope + z30^2 * z10 - z30 * x10^2 + z30 * y10^2 + z30 * z10^2 -
z30^3 - x10^2 * z10 - y10^2 * z10 + 2 * z30 * x10 * x30 + y30^2 * z10 -
z10^3 - x30^2 * z10 - y30^2 * z30 + 2 * z10 * x30 * x10 - x30^2 * z30 +
(-(-y30 + y10)^2 * (8 * y30 * y10 * z10 * z30 - 4 * y30 * y10 * x30^2 -
4 * y10 * y30 * z10^2 - 4 * y10 * y30 * x10^2 - 4 * y30 * y10 * z30^2 +
x30^4 + y30^4 + z30^4 + x10^4 + y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2 *
x30^2 * z10^2 + 2 * y30^2 * z30^2 + 2 * y30^2 * x10^2 + 6 * y30^2 *
y10^2 + 2 * y30^2 * z10^2 + 2 * z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 *
z30^2 * z10^2 + 2 * x10^2 * y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 *
z10^2 - 16 * y10^2 - 16 * z10^2 - 16 * y30^2 - 16 * z30^2 - 4 * y30^2 *
z30 * z10 - 4 * z30 * y10^2 * z10 + 32 * z30 * z10 - 4 * y30 * y10^3 +
32 * y30 * y10 - 4 * z30 * z10 * x10^2 - 4 * z30 * z10 * x30^2 - 4 * y10
* y30^3 + 2 * x30^2 * y30^2 + 2 * x30^2 * z30^2 - 2 * x30^2 * x10^2 - 4
* z30^3 * z10 - 4 * z10^3 * z30) * slope^4 + (-2 * (x10 - x30) * (-y30 +
y10) * (8 * y30 * y10 * z10 * z30 - 4 * y30 * y10 * x30^2 - 4 * y10 *
y30 * z10^2 - 4 * y10 * y30 * x10^2 - 4 * y30 * y10 * z30^2 + x30^4 +
y30^4 + z30^4 + x10^4 + y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2 * x30^2 *
z10^2 + 2 * y30^2 * z30^2 + 2 * y30^2 * x10^2 + 6 * y30^2 * y10^2 + 2 *
y30^2 * z10^2 + 2 * z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 * z30^2 *
z10^2 + 2 * x10^2 * y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 * z10^2 - 16 *
y10^2 - 16 * z10^2 - 16 * y30^2 - 16 * z30^2 - 4 * y30^2 * z30 * z10 - 4
* z30 * y10^2 * z10 + 32 * z30 * z10 - 4 * y30 * y10^3 + 32 * y30 * y10
- 4 * z30 * z10 * x10^2 - 4 * z30 * z10 * x30^2 - 4 * y10 * y30^3 + 2 *
x30^2 * y30^2 + 2 * x30^2 * z30^2 - 2 * x30^2 * x10^2 - 4 * z30^3 * z10
- 4 * z10^3 * z30) - (-y30 + y10)^2 * (-4 * y10 * x30 * x10^2 - 4 * x10
* y30^3 - 4 * y30 * x10 * x30^2 + 8 * y10 * x10 * x30^2 + 32 * x30 * y10
- 4 * x30 * y10 * y30^2 - 4 * y30 * x10 * z30^2 - 4 * x30 * y10 * z30^2
+ 8 * y30 * x30 * x10^2 - 32 * y30 * x30 - 4 * x10 * y30 * z10^2 - 4 *
y10 * x30 * z10^2 - 4 * x10 * y30 * y10^2 - 32 * y10 * x10 - 4 * x30 *
y10^3 + 8 * y10 * x10 * y30^2 + 8 * x30 * y10 * z10 * z30 + 32 * y30 *
x10 - 4 * y10 * x30^3 + 8 * y30 * x30 * y10^2 - 4 * y30 * x10^3 + 8 *
y30 * x10 * z10 * z30)) * slope^3 + (-(x10 - x30)^2 * (8 * y30 * y10 *
z10 * z30 - 4 * y30 * y10 * x30^2 - 4 * y10 * y30 * z10^2 - 4 * y10 *
y30 * x10^2 - 4 * y30 * y10 * z30^2 + x30^4 + y30^4 + z30^4 + x10^4 +
y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2 * x30^2 * z10^2 + 2 * y30^2 *
z30^2 + 2 * y30^2 * x10^2 + 6 * y30^2 * y10^2 + 2 * y30^2 * z10^2 + 2 *
z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 * z30^2 * z10^2 + 2 * x10^2 *
y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 * z10^2 - 16 * y10^2 - 16 * z10^2
- 16 * y30^2 - 16 * z30^2 - 4 * y30^2 * z30 * z10 - 4 * z30 * y10^2 *
z10 + 32 * z30 * z10 - 4 * y30 * y10^3 + 32 * y30 * y10 - 4 * z30 * z10
* x10^2 - 4 * z30 * z10 * x30^2 - 4 * y10 * y30^3 + 2 * x30^2 * y30^2 +
2 * x30^2 * z30^2 - 2 * x30^2 * x10^2 - 4 * z30^3 * z10 - 4 * z10^3 *
z30) - 2 * (x10 - x30) * (-y30 + y10) * (-4 * y10 * x30 * x10^2 - 4 *
x10 * y30^3 - 4 * y30 * x10 * x30^2 + 8 * y10 * x10 * x30^2 + 32 * x30 *
y10 - 4 * x30 * y10 * y30^2 - 4 * y30 * x10 * z30^2 - 4 * x30 * y10 *
z30^2 + 8 * y30 * x30 * x10^2 - 32 * y30 * x30 - 4 * x10 * y30 * z10^2 -
4 * y10 * x30 * z10^2 - 4 * x10 * y30 * y10^2 - 32 * y10 * x10 - 4 * x30
* y10^3 + 8 * y10 * x10 * y30^2 + 8 * x30 * y10 * z10 * z30 + 32 * y30 *
x10 - 4 * y10 * x30^3 + 8 * y30 * x30 * y10^2 - 4 * y30 * x10^3 + 8 *
y30 * x10 * z10 * z30) - (-y30 + y10)^2 * (x30^4 + y30^4 + z30^4 + x10^4
+ y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2 * x30^2 * z10^2 + 2 * y30^2 *
z30^2 + 2 * y30^2 * x10^2 - 2 * y30^2 * y10^2 + 2 * y30^2 * z10^2 + 2 *
z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 * z30^2 * z10^2 + 2 * x10^2 *
y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 * z10^2 - 4 * x30^3 * x10 + 32 *
x10 * x30 - 4 * x10^3 * x30 + 8 * z30 * z10 * x10 * x30 - 16 * x10^2 -
16 * z10^2 - 16 * x30^2 - 16 * z30^2 - 4 * y30^2 * z30 * z10 - 4 * z30 *
y10^2 * z10 + 32 * z30 * z10 - 4 * z30 * z10 * x10^2 - 4 * z30 * z10 *
x30^2 + 2 * x30^2 * y30^2 + 2 * x30^2 * z30^2 + 6 * x30^2 * x10^2 - 4 *
z30^3 * z10 - 4 * z10^3 * z30 - 4 * y30^2 * x10 * x30 - 4 * z30^2 * x10
* x30 - 4 * y10^2 * x30 * x10 - 4 * z10^2 * x30 * x10)) * slope^2 +
(-(x10 - x30)^2 * (-4 * y10 * x30 * x10^2 - 4 * x10 * y30^3 - 4 * y30 *
x10 * x30^2 + 8 * y10 * x10 * x30^2 + 32 * x30 * y10 - 4 * x30 * y10 *
y30^2 - 4 * y30 * x10 * z30^2 - 4 * x30 * y10 * z30^2 + 8 * y30 * x30 *
x10^2 - 32 * y30 * x30 - 4 * x10 * y30 * z10^2 - 4 * y10 * x30 * z10^2 -
4 * x10 * y30 * y10^2 - 32 * y10 * x10 - 4 * x30 * y10^3 + 8 * y10 * x10
* y30^2 + 8 * x30 * y10 * z10 * z30 + 32 * y30 * x10 - 4 * y10 * x30^3 +
8 * y30 * x30 * y10^2 - 4 * y30 * x10^3 + 8 * y30 * x10 * z10 * z30) - 2
* (x10 - x30) * (-y30 + y10) * (x30^4 + y30^4 + z30^4 + x10^4 + y10^4 +
z10^4 + 2 * x30^2 * y10^2 + 2 * x30^2 * z10^2 + 2 * y30^2 * z30^2 + 2 *
y30^2 * x10^2 - 2 * y30^2 * y10^2 + 2 * y30^2 * z10^2 + 2 * z30^2 *
x10^2 + 2 * z30^2 * y10^2 + 6 * z30^2 * z10^2 + 2 * x10^2 * y10^2 + 2 *
x10^2 * z10^2 + 2 * y10^2 * z10^2 - 4 * x30^3 * x10 + 32 * x10 * x30 - 4
* x10^3 * x30 + 8 * z30 * z10 * x10 * x30 - 16 * x10^2 - 16 * z10^2 - 16
* x30^2 - 16 * z30^2 - 4 * y30^2 * z30 * z10 - 4 * z30 * y10^2 * z10 +
32 * z30 * z10 - 4 * z30 * z10 * x10^2 - 4 * z30 * z10 * x30^2 + 2 *
x30^2 * y30^2 + 2 * x30^2 * z30^2 + 6 * x30^2 * x10^2 - 4 * z30^3 * z10
- 4 * z10^3 * z30 - 4 * y30^2 * x10 * x30 - 4 * z30^2 * x10 * x30 - 4 *
y10^2 * x30 * x10 - 4 * z10^2 * x30 * x10)) * slope - (x10 - x30)^2 *
(x30^4 + y30^4 + z30^4 + x10^4 + y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2 *
x30^2 * z10^2 + 2 * y30^2 * z30^2 + 2 * y30^2 * x10^2 - 2 * y30^2 *
y10^2 + 2 * y30^2 * z10^2 + 2 * z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 *
z30^2 * z10^2 + 2 * x10^2 * y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 *
z10^2 - 4 * x30^3 * x10 + 32 * x10 * x30 - 4 * x10^3 * x30 + 8 * z30 *
z10 * x10 * x30 - 16 * x10^2 - 16 * z10^2 - 16 * x30^2 - 16 * z30^2 - 4
* y30^2 * z30 * z10 - 4 * z30 * y10^2 * z10 + 32 * z30 * z10 - 4 * z30 *
z10 * x10^2 - 4 * z30 * z10 * x30^2 + 2 * x30^2 * y30^2 + 2 * x30^2 *
z30^2 + 6 * x30^2 * x10^2 - 4 * z30^3 * z10 - 4 * z10^3 * z30 - 4 *
y30^2 * x10 * x30 - 4 * z30^2 * x10 * x30 - 4 * y10^2 * x30 * x10 - 4 *
z10^2 * x30 * x10))^(1/2))/((-2 * z30 * z10 - 2 * y30 * y10 + z30^2 +
z10^2 + y10^2 + y30^2) * slope^2 + (2 * y10 * x10 - 2 * y30 * x10 - 2 *
x30 * y10 + 2 * y30 * x30) * slope + z30^2 + z10^2 + x10^2 + x30^2 - 2 *
x10 * x30 - 2 * z30 * z10),

x20 = (1/2) * ((2 * y30^2 * z30 * z10 - 2 * y10 * y30 * x10^2 - 2 * z30
* y10^2 * z10 - x30^2 * y10^2 - y30^2 * z30^2 + y30^2 * x10^2 + z30^2 *
y10^2 + x10^2 * y10^2 + y10^2 * z10^2 - y30^4 + 2 * y30 * y10 * x30^2 +
2 * y10 * y30^3 - y30^2 * z10^2 - x30^2 * y30^2 + y10^4 - 2 * y30 *
y10^3) * slope^2 + (-2 * y30^3 * x30 + 2 * y30 * x30 * y10^2 + 4 * y30 *
x30 * z10 * z30 - 2 * y30 * x30^3 + 2 * y30 * x10 * x30^2 - 4 * y10 *
x10 * z10 * z30 + 2 * y10 * x10^3 - 2 * y10 * x30 * x10^2 + 2 * y10^3 *
x10 - 2 * x30 * y10^3 + 2 * y30 * x30 * x10^2 - 2 * y30 * x30 * z10^2 -
2 * y30 * x30 * z30^2 + 2 * y10 * x10 * z10^2 - 2 * x10 * y30 * y10^2 +
2 * x10 * y30^3 - 2 * y10 * x10 * y30^2 + 2 * x30 * y10 * y30^2 - 2 *
y10 * x10 * x30^2 + 2 * y10 * x10 * z30^2 + 2 * y10 * x30^3 - 2 * y30 *
x10^3) * slope + x10^2 * z10^2 - 2 * y10^2 * x30 * x10 + z10 * (-(-y30 +
y10)^2 * (8 * y30 * y10 * z10 * z30 - 4 * y30 * y10 * x30^2 - 4 * y10 *
y30 * z10^2 - 4 * y10 * y30 * x10^2 - 4 * y30 * y10 * z30^2 + x30^4 +
y30^4 + z30^4 + x10^4 + y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2 * x30^2 *
z10^2 + 2 * y30^2 * z30^2 + 2 * y30^2 * x10^2 + 6 * y30^2 * y10^2 + 2 *
y30^2 * z10^2 + 2 * z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 * z30^2 *
z10^2 + 2 * x10^2 * y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 * z10^2 - 16 *
y10^2 - 16 * z10^2 - 16 * y30^2 - 16 * z30^2 - 4 * y30^2 * z30 * z10 - 4
* z30 * y10^2 * z10 + 32 * z30 * z10 - 4 * y30 * y10^3 + 32 * y30 * y10
- 4 * z30 * z10 * x10^2 - 4 * z30 * z10 * x30^2 - 4 * y10 * y30^3 + 2 *
x30^2 * y30^2 + 2 * x30^2 * z30^2 - 2 * x30^2 * x10^2 - 4 * z30^3 * z10
- 4 * z10^3 * z30) * slope^4 + (-2 * (x10 - x30) * (-y30 + y10) * (8 *
y30 * y10 * z10 * z30 - 4 * y30 * y10 * x30^2 - 4 * y10 * y30 * z10^2 -
4 * y10 * y30 * x10^2 - 4 * y30 * y10 * z30^2 + x30^4 + y30^4 + z30^4 +
x10^4 + y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2 * x30^2 * z10^2 + 2 *
y30^2 * z30^2 + 2 * y30^2 * x10^2 + 6 * y30^2 * y10^2 + 2 * y30^2 *
z10^2 + 2 * z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 * z30^2 * z10^2 + 2 *
x10^2 * y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 * z10^2 - 16 * y10^2 - 16
* z10^2 - 16 * y30^2 - 16 * z30^2 - 4 * y30^2 * z30 * z10 - 4 * z30 *
y10^2 * z10 + 32 * z30 * z10 - 4 * y30 * y10^3 + 32 * y30 * y10 - 4 *
z30 * z10 * x10^2 - 4 * z30 * z10 * x30^2 - 4 * y10 * y30^3 + 2 * x30^2
* y30^2 + 2 * x30^2 * z30^2 - 2 * x30^2 * x10^2 - 4 * z30^3 * z10 - 4 *
z10^3 * z30) - (-y30 + y10)^2 * (-4 * y10 * x30 * x10^2 - 4 * x10 *
y30^3 - 4 * y30 * x10 * x30^2 + 8 * y10 * x10 * x30^2 + 32 * x30 * y10 -
4 * x30 * y10 * y30^2 - 4 * y30 * x10 * z30^2 - 4 * x30 * y10 * z30^2 +
8 * y30 * x30 * x10^2 - 32 * y30 * x30 - 4 * x10 * y30 * z10^2 - 4 * y10
* x30 * z10^2 - 4 * x10 * y30 * y10^2 - 32 * y10 * x10 - 4 * x30 * y10^3
+ 8 * y10 * x10 * y30^2 + 8 * x30 * y10 * z10 * z30 + 32 * y30 * x10 - 4
* y10 * x30^3 + 8 * y30 * x30 * y10^2 - 4 * y30 * x10^3 + 8 * y30 * x10
* z10 * z30)) * slope^3 + (-(x10 - x30)^2 * (8 * y30 * y10 * z10 * z30 -
4 * y30 * y10 * x30^2 - 4 * y10 * y30 * z10^2 - 4 * y10 * y30 * x10^2 -
4 * y30 * y10 * z30^2 + x30^4 + y30^4 + z30^4 + x10^4 + y10^4 + z10^4 +
2 * x30^2 * y10^2 + 2 * x30^2 * z10^2 + 2 * y30^2 * z30^2 + 2 * y30^2 *
x10^2 + 6 * y30^2 * y10^2 + 2 * y30^2 * z10^2 + 2 * z30^2 * x10^2 + 2 *
z30^2 * y10^2 + 6 * z30^2 * z10^2 + 2 * x10^2 * y10^2 + 2 * x10^2 *
z10^2 + 2 * y10^2 * z10^2 - 16 * y10^2 - 16 * z10^2 - 16 * y30^2 - 16 *
z30^2 - 4 * y30^2 * z30 * z10 - 4 * z30 * y10^2 * z10 + 32 * z30 * z10 -
4 * y30 * y10^3 + 32 * y30 * y10 - 4 * z30 * z10 * x10^2 - 4 * z30 * z10
* x30^2 - 4 * y10 * y30^3 + 2 * x30^2 * y30^2 + 2 * x30^2 * z30^2 - 2 *
x30^2 * x10^2 - 4 * z30^3 * z10 - 4 * z10^3 * z30) - 2 * (x10 - x30) *
(-y30 + y10) * (-4 * y10 * x30 * x10^2 - 4 * x10 * y30^3 - 4 * y30 * x10
* x30^2 + 8 * y10 * x10 * x30^2 + 32 * x30 * y10 - 4 * x30 * y10 * y30^2
- 4 * y30 * x10 * z30^2 - 4 * x30 * y10 * z30^2 + 8 * y30 * x30 * x10^2
- 32 * y30 * x30 - 4 * x10 * y30 * z10^2 - 4 * y10 * x30 * z10^2 - 4 *
x10 * y30 * y10^2 - 32 * y10 * x10 - 4 * x30 * y10^3 + 8 * y10 * x10 *
y30^2 + 8 * x30 * y10 * z10 * z30 + 32 * y30 * x10 - 4 * y10 * x30^3 + 8
* y30 * x30 * y10^2 - 4 * y30 * x10^3 + 8 * y30 * x10 * z10 * z30) -
(-y30 + y10)^2 * (x30^4 + y30^4 + z30^4 + x10^4 + y10^4 + z10^4 + 2 *
x30^2 * y10^2 + 2 * x30^2 * z10^2 + 2 * y30^2 * z30^2 + 2 * y30^2 *
x10^2 - 2 * y30^2 * y10^2 + 2 * y30^2 * z10^2 + 2 * z30^2 * x10^2 + 2 *
z30^2 * y10^2 + 6 * z30^2 * z10^2 + 2 * x10^2 * y10^2 + 2 * x10^2 *
z10^2 + 2 * y10^2 * z10^2 - 4 * x30^3 * x10 + 32 * x10 * x30 - 4 * x10^3
* x30 + 8 * z30 * z10 * x10 * x30 - 16 * x10^2 - 16 * z10^2 - 16 * x30^2
- 16 * z30^2 - 4 * y30^2 * z30 * z10 - 4 * z30 * y10^2 * z10 + 32 * z30
* z10 - 4 * z30 * z10 * x10^2 - 4 * z30 * z10 * x30^2 + 2 * x30^2 *
y30^2 + 2 * x30^2 * z30^2 + 6 * x30^2 * x10^2 - 4 * z30^3 * z10 - 4 *
z10^3 * z30 - 4 * y30^2 * x10 * x30 - 4 * z30^2 * x10 * x30 - 4 * y10^2
* x30 * x10 - 4 * z10^2 * x30 * x10)) * slope^2 + (-(x10 - x30)^2 * (-4
* y10 * x30 * x10^2 - 4 * x10 * y30^3 - 4 * y30 * x10 * x30^2 + 8 * y10
* x10 * x30^2 + 32 * x30 * y10 - 4 * x30 * y10 * y30^2 - 4 * y30 * x10 *
z30^2 - 4 * x30 * y10 * z30^2 + 8 * y30 * x30 * x10^2 - 32 * y30 * x30 -
4 * x10 * y30 * z10^2 - 4 * y10 * x30 * z10^2 - 4 * x10 * y30 * y10^2 -
32 * y10 * x10 - 4 * x30 * y10^3 + 8 * y10 * x10 * y30^2 + 8 * x30 * y10
* z10 * z30 + 32 * y30 * x10 - 4 * y10 * x30^3 + 8 * y30 * x30 * y10^2 -
4 * y30 * x10^3 + 8 * y30 * x10 * z10 * z30) - 2 * (x10 - x30) * (-y30 +
y10) * (x30^4 + y30^4 + z30^4 + x10^4 + y10^4 + z10^4 + 2 * x30^2 *
y10^2 + 2 * x30^2 * z10^2 + 2 * y30^2 * z30^2 + 2 * y30^2 * x10^2 - 2 *
y30^2 * y10^2 + 2 * y30^2 * z10^2 + 2 * z30^2 * x10^2 + 2 * z30^2 *
y10^2 + 6 * z30^2 * z10^2 + 2 * x10^2 * y10^2 + 2 * x10^2 * z10^2 + 2 *
y10^2 * z10^2 - 4 * x30^3 * x10 + 32 * x10 * x30 - 4 * x10^3 * x30 + 8 *
z30 * z10 * x10 * x30 - 16 * x10^2 - 16 * z10^2 - 16 * x30^2 - 16 *
z30^2 - 4 * y30^2 * z30 * z10 - 4 * z30 * y10^2 * z10 + 32 * z30 * z10 -
4 * z30 * z10 * x10^2 - 4 * z30 * z10 * x30^2 + 2 * x30^2 * y30^2 + 2 *
x30^2 * z30^2 + 6 * x30^2 * x10^2 - 4 * z30^3 * z10 - 4 * z10^3 * z30 -
4 * y30^2 * x10 * x30 - 4 * z30^2 * x10 * x30 - 4 * y10^2 * x30 * x10 -
4 * z10^2 * x30 * x10)) * slope - (x10 - x30)^2 * (x30^4 + y30^4 + z30^4
+ x10^4 + y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2 * x30^2 * z10^2 + 2 *
y30^2 * z30^2 + 2 * y30^2 * x10^2 - 2 * y30^2 * y10^2 + 2 * y30^2 *
z10^2 + 2 * z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 * z30^2 * z10^2 + 2 *
x10^2 * y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 * z10^2 - 4 * x30^3 * x10
+ 32 * x10 * x30 - 4 * x10^3 * x30 + 8 * z30 * z10 * x10 * x30 - 16 *
x10^2 - 16 * z10^2 - 16 * x30^2 - 16 * z30^2 - 4 * y30^2 * z30 * z10 - 4
* z30 * y10^2 * z10 + 32 * z30 * z10 - 4 * z30 * z10 * x10^2 - 4 * z30 *
z10 * x30^2 + 2 * x30^2 * y30^2 + 2 * x30^2 * z30^2 + 6 * x30^2 * x10^2
- 4 * z30^3 * z10 - 4 * z10^3 * z30 - 4 * y30^2 * x10 * x30 - 4 * z30^2
* x10 * x30 - 4 * y10^2 * x30 * x10 - 4 * z10^2 * x30 * x10))^(1/2) -
z30 * (-(-y30 + y10)^2 * (8 * y30 * y10 * z10 * z30 - 4 * y30 * y10 *
x30^2 - 4 * y10 * y30 * z10^2 - 4 * y10 * y30 * x10^2 - 4 * y30 * y10 *
z30^2 + x30^4 + y30^4 + z30^4 + x10^4 + y10^4 + z10^4 + 2 * x30^2 *
y10^2 + 2 * x30^2 * z10^2 + 2 * y30^2 * z30^2 + 2 * y30^2 * x10^2 + 6 *
y30^2 * y10^2 + 2 * y30^2 * z10^2 + 2 * z30^2 * x10^2 + 2 * z30^2 *
y10^2 + 6 * z30^2 * z10^2 + 2 * x10^2 * y10^2 + 2 * x10^2 * z10^2 + 2 *
y10^2 * z10^2 - 16 * y10^2 - 16 * z10^2 - 16 * y30^2 - 16 * z30^2 - 4 *
y30^2 * z30 * z10 - 4 * z30 * y10^2 * z10 + 32 * z30 * z10 - 4 * y30 *
y10^3 + 32 * y30 * y10 - 4 * z30 * z10 * x10^2 - 4 * z30 * z10 * x30^2 -
4 * y10 * y30^3 + 2 * x30^2 * y30^2 + 2 * x30^2 * z30^2 - 2 * x30^2 *
x10^2 - 4 * z30^3 * z10 - 4 * z10^3 * z30) * slope^4 + (-2 * (x10 - x30)
* (-y30 + y10) * (8 * y30 * y10 * z10 * z30 - 4 * y30 * y10 * x30^2 - 4
* y10 * y30 * z10^2 - 4 * y10 * y30 * x10^2 - 4 * y30 * y10 * z30^2 +
x30^4 + y30^4 + z30^4 + x10^4 + y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2 *
x30^2 * z10^2 + 2 * y30^2 * z30^2 + 2 * y30^2 * x10^2 + 6 * y30^2 *
y10^2 + 2 * y30^2 * z10^2 + 2 * z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 *
z30^2 * z10^2 + 2 * x10^2 * y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 *
z10^2 - 16 * y10^2 - 16 * z10^2 - 16 * y30^2 - 16 * z30^2 - 4 * y30^2 *
z30 * z10 - 4 * z30 * y10^2 * z10 + 32 * z30 * z10 - 4 * y30 * y10^3 +
32 * y30 * y10 - 4 * z30 * z10 * x10^2 - 4 * z30 * z10 * x30^2 - 4 * y10
* y30^3 + 2 * x30^2 * y30^2 + 2 * x30^2 * z30^2 - 2 * x30^2 * x10^2 - 4
* z30^3 * z10 - 4 * z10^3 * z30) - (-y30 + y10)^2 * (-4 * y10 * x30 *
x10^2 - 4 * x10 * y30^3 - 4 * y30 * x10 * x30^2 + 8 * y10 * x10 * x30^2
+ 32 * x30 * y10 - 4 * x30 * y10 * y30^2 - 4 * y30 * x10 * z30^2 - 4 *
x30 * y10 * z30^2 + 8 * y30 * x30 * x10^2 - 32 * y30 * x30 - 4 * x10 *
y30 * z10^2 - 4 * y10 * x30 * z10^2 - 4 * x10 * y30 * y10^2 - 32 * y10 *
x10 - 4 * x30 * y10^3 + 8 * y10 * x10 * y30^2 + 8 * x30 * y10 * z10 *
z30 + 32 * y30 * x10 - 4 * y10 * x30^3 + 8 * y30 * x30 * y10^2 - 4 * y30
* x10^3 + 8 * y30 * x10 * z10 * z30)) * slope^3 + (-(x10 - x30)^2 * (8 *
y30 * y10 * z10 * z30 - 4 * y30 * y10 * x30^2 - 4 * y10 * y30 * z10^2 -
4 * y10 * y30 * x10^2 - 4 * y30 * y10 * z30^2 + x30^4 + y30^4 + z30^4 +
x10^4 + y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2 * x30^2 * z10^2 + 2 *
y30^2 * z30^2 + 2 * y30^2 * x10^2 + 6 * y30^2 * y10^2 + 2 * y30^2 *
z10^2 + 2 * z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 * z30^2 * z10^2 + 2 *
x10^2 * y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 * z10^2 - 16 * y10^2 - 16
* z10^2 - 16 * y30^2 - 16 * z30^2 - 4 * y30^2 * z30 * z10 - 4 * z30 *
y10^2 * z10 + 32 * z30 * z10 - 4 * y30 * y10^3 + 32 * y30 * y10 - 4 *
z30 * z10 * x10^2 - 4 * z30 * z10 * x30^2 - 4 * y10 * y30^3 + 2 * x30^2
* y30^2 + 2 * x30^2 * z30^2 - 2 * x30^2 * x10^2 - 4 * z30^3 * z10 - 4 *
z10^3 * z30) - 2 * (x10 - x30) * (-y30 + y10) * (-4 * y10 * x30 * x10^2
- 4 * x10 * y30^3 - 4 * y30 * x10 * x30^2 + 8 * y10 * x10 * x30^2 + 32 *
x30 * y10 - 4 * x30 * y10 * y30^2 - 4 * y30 * x10 * z30^2 - 4 * x30 *
y10 * z30^2 + 8 * y30 * x30 * x10^2 - 32 * y30 * x30 - 4 * x10 * y30 *
z10^2 - 4 * y10 * x30 * z10^2 - 4 * x10 * y30 * y10^2 - 32 * y10 * x10 -
4 * x30 * y10^3 + 8 * y10 * x10 * y30^2 + 8 * x30 * y10 * z10 * z30 + 32
* y30 * x10 - 4 * y10 * x30^3 + 8 * y30 * x30 * y10^2 - 4 * y30 * x10^3
+ 8 * y30 * x10 * z10 * z30) - (-y30 + y10)^2 * (x30^4 + y30^4 + z30^4 +
x10^4 + y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2 * x30^2 * z10^2 + 2 *
y30^2 * z30^2 + 2 * y30^2 * x10^2 - 2 * y30^2 * y10^2 + 2 * y30^2 *
z10^2 + 2 * z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 * z30^2 * z10^2 + 2 *
x10^2 * y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 * z10^2 - 4 * x30^3 * x10
+ 32 * x10 * x30 - 4 * x10^3 * x30 + 8 * z30 * z10 * x10 * x30 - 16 *
x10^2 - 16 * z10^2 - 16 * x30^2 - 16 * z30^2 - 4 * y30^2 * z30 * z10 - 4
* z30 * y10^2 * z10 + 32 * z30 * z10 - 4 * z30 * z10 * x10^2 - 4 * z30 *
z10 * x30^2 + 2 * x30^2 * y30^2 + 2 * x30^2 * z30^2 + 6 * x30^2 * x10^2
- 4 * z30^3 * z10 - 4 * z10^3 * z30 - 4 * y30^2 * x10 * x30 - 4 * z30^2
* x10 * x30 - 4 * y10^2 * x30 * x10 - 4 * z10^2 * x30 * x10)) * slope^2
+ (-(x10 - x30)^2 * (-4 * y10 * x30 * x10^2 - 4 * x10 * y30^3 - 4 * y30
* x10 * x30^2 + 8 * y10 * x10 * x30^2 + 32 * x30 * y10 - 4 * x30 * y10 *
y30^2 - 4 * y30 * x10 * z30^2 - 4 * x30 * y10 * z30^2 + 8 * y30 * x30 *
x10^2 - 32 * y30 * x30 - 4 * x10 * y30 * z10^2 - 4 * y10 * x30 * z10^2 -
4 * x10 * y30 * y10^2 - 32 * y10 * x10 - 4 * x30 * y10^3 + 8 * y10 * x10
* y30^2 + 8 * x30 * y10 * z10 * z30 + 32 * y30 * x10 - 4 * y10 * x30^3 +
8 * y30 * x30 * y10^2 - 4 * y30 * x10^3 + 8 * y30 * x10 * z10 * z30) - 2
* (x10 - x30) * (-y30 + y10) * (x30^4 + y30^4 + z30^4 + x10^4 + y10^4 +
z10^4 + 2 * x30^2 * y10^2 + 2 * x30^2 * z10^2 + 2 * y30^2 * z30^2 + 2 *
y30^2 * x10^2 - 2 * y30^2 * y10^2 + 2 * y30^2 * z10^2 + 2 * z30^2 *
x10^2 + 2 * z30^2 * y10^2 + 6 * z30^2 * z10^2 + 2 * x10^2 * y10^2 + 2 *
x10^2 * z10^2 + 2 * y10^2 * z10^2 - 4 * x30^3 * x10 + 32 * x10 * x30 - 4
* x10^3 * x30 + 8 * z30 * z10 * x10 * x30 - 16 * x10^2 - 16 * z10^2 - 16
* x30^2 - 16 * z30^2 - 4 * y30^2 * z30 * z10 - 4 * z30 * y10^2 * z10 +
32 * z30 * z10 - 4 * z30 * z10 * x10^2 - 4 * z30 * z10 * x30^2 + 2 *
x30^2 * y30^2 + 2 * x30^2 * z30^2 + 6 * x30^2 * x10^2 - 4 * z30^3 * z10
- 4 * z10^3 * z30 - 4 * y30^2 * x10 * x30 - 4 * z30^2 * x10 * x30 - 4 *
y10^2 * x30 * x10 - 4 * z10^2 * x30 * x10)) * slope - (x10 - x30)^2 *
(x30^4 + y30^4 + z30^4 + x10^4 + y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2 *
x30^2 * z10^2 + 2 * y30^2 * z30^2 + 2 * y30^2 * x10^2 - 2 * y30^2 *
y10^2 + 2 * y30^2 * z10^2 + 2 * z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 *
z30^2 * z10^2 + 2 * x10^2 * y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 *
z10^2 - 4 * x30^3 * x10 + 32 * x10 * x30 - 4 * x10^3 * x30 + 8 * z30 *
z10 * x10 * x30 - 16 * x10^2 - 16 * z10^2 - 16 * x30^2 - 16 * z30^2 - 4
* y30^2 * z30 * z10 - 4 * z30 * y10^2 * z10 + 32 * z30 * z10 - 4 * z30 *
z10 * x10^2 - 4 * z30 * z10 * x30^2 + 2 * x30^2 * y30^2 + 2 * x30^2 *
z30^2 + 6 * x30^2 * x10^2 - 4 * z30^3 * z10 - 4 * z10^3 * z30 - 4 *
y30^2 * x10 * x30 - 4 * z30^2 * x10 * x30 - 4 * y10^2 * x30 * x10 - 4 *
z10^2 * x30 * x10))^(1/2) - x30^2 * z10^2 - x30^4 + x10^4 + x30^2 *
y10^2 + x10^2 * y10^2 + 2 * y30^2 * x10 * x30 - y30^2 * x10^2 + z30^2 *
x10^2 - 2 * x10^3 * x30 - x30^2 * z30^2 + 2 * x30^3 * x10 + 2 * z30 *
z10 * x30^2 - x30^2 * y30^2 - 2 * z30 * z10 * x10^2)/(((-2 * z30 * z10 -
2 * y30 * y10 + z30^2 + z10^2 + y10^2 + y30^2) * slope^2 + (2 * y10 *
x10 - 2 * y30 * x10 - 2 * x30 * y10 + 2 * y30 * x30) * slope + z30^2 +
z10^2 + x10^2 + x30^2 - 2 * x10 * x30 - 2 * z30 * z10) * ((-y30 + y10) *
slope + x10 - x30)),

y20 = (1/2) * slope * ((2 * y30^2 * z30 * z10 - 2 * y10 * y30 * x10^2 -
2 * z30 * y10^2 * z10 - x30^2 * y10^2 - y30^2 * z30^2 + y30^2 * x10^2 +
z30^2 * y10^2 + x10^2 * y10^2 + y10^2 * z10^2 - y30^4 + 2 * y30 * y10 *
x30^2 + 2 * y10 * y30^3 - y30^2 * z10^2 - x30^2 * y30^2 + y10^4 - 2 *
y30 * y10^3) * slope^2 + (-2 * y30^3 * x30 + 2 * y30 * x30 * y10^2 + 4 *
y30 * x30 * z10 * z30 - 2 * y30 * x30^3 + 2 * y30 * x10 * x30^2 - 4 *
y10 * x10 * z10 * z30 + 2 * y10 * x10^3 - 2 * y10 * x30 * x10^2 + 2 *
y10^3 * x10 - 2 * x30 * y10^3 + 2 * y30 * x30 * x10^2 - 2 * y30 * x30 *
z10^2 - 2 * y30 * x30 * z30^2 + 2 * y10 * x10 * z10^2 - 2 * x10 * y30 *
y10^2 + 2 * x10 * y30^3 - 2 * y10 * x10 * y30^2 + 2 * x30 * y10 * y30^2
- 2 * y10 * x10 * x30^2 + 2 * y10 * x10 * z30^2 + 2 * y10 * x30^3 - 2 *
y30 * x10^3) * slope + x10^2 * z10^2 - 2 * y10^2 * x30 * x10 + z10 *
(-(-y30 + y10)^2 * (8 * y30 * y10 * z10 * z30 - 4 * y30 * y10 * x30^2 -
4 * y10 * y30 * z10^2 - 4 * y10 * y30 * x10^2 - 4 * y30 * y10 * z30^2 +
x30^4 + y30^4 + z30^4 + x10^4 + y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2 *
x30^2 * z10^2 + 2 * y30^2 * z30^2 + 2 * y30^2 * x10^2 + 6 * y30^2 *
y10^2 + 2 * y30^2 * z10^2 + 2 * z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 *
z30^2 * z10^2 + 2 * x10^2 * y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 *
z10^2 - 16 * y10^2 - 16 * z10^2 - 16 * y30^2 - 16 * z30^2 - 4 * y30^2 *
z30 * z10 - 4 * z30 * y10^2 * z10 + 32 * z30 * z10 - 4 * y30 * y10^3 +
32 * y30 * y10 - 4 * z30 * z10 * x10^2 - 4 * z30 * z10 * x30^2 - 4 * y10
* y30^3 + 2 * x30^2 * y30^2 + 2 * x30^2 * z30^2 - 2 * x30^2 * x10^2 - 4
* z30^3 * z10 - 4 * z10^3 * z30) * slope^4 + (-2 * (x10 - x30) * (-y30 +
y10) * (8 * y30 * y10 * z10 * z30 - 4 * y30 * y10 * x30^2 - 4 * y10 *
y30 * z10^2 - 4 * y10 * y30 * x10^2 - 4 * y30 * y10 * z30^2 + x30^4 +
y30^4 + z30^4 + x10^4 + y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2 * x30^2 *
z10^2 + 2 * y30^2 * z30^2 + 2 * y30^2 * x10^2 + 6 * y30^2 * y10^2 + 2 *
y30^2 * z10^2 + 2 * z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 * z30^2 *
z10^2 + 2 * x10^2 * y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 * z10^2 - 16 *
y10^2 - 16 * z10^2 - 16 * y30^2 - 16 * z30^2 - 4 * y30^2 * z30 * z10 - 4
* z30 * y10^2 * z10 + 32 * z30 * z10 - 4 * y30 * y10^3 + 32 * y30 * y10
- 4 * z30 * z10 * x10^2 - 4 * z30 * z10 * x30^2 - 4 * y10 * y30^3 + 2 *
x30^2 * y30^2 + 2 * x30^2 * z30^2 - 2 * x30^2 * x10^2 - 4 * z30^3 * z10
- 4 * z10^3 * z30) - (-y30 + y10)^2 * (-4 * y10 * x30 * x10^2 - 4 * x10
* y30^3 - 4 * y30 * x10 * x30^2 + 8 * y10 * x10 * x30^2 + 32 * x30 * y10
- 4 * x30 * y10 * y30^2 - 4 * y30 * x10 * z30^2 - 4 * x30 * y10 * z30^2
+ 8 * y30 * x30 * x10^2 - 32 * y30 * x30 - 4 * x10 * y30 * z10^2 - 4 *
y10 * x30 * z10^2 - 4 * x10 * y30 * y10^2 - 32 * y10 * x10 - 4 * x30 *
y10^3 + 8 * y10 * x10 * y30^2 + 8 * x30 * y10 * z10 * z30 + 32 * y30 *
x10 - 4 * y10 * x30^3 + 8 * y30 * x30 * y10^2 - 4 * y30 * x10^3 + 8 *
y30 * x10 * z10 * z30)) * slope^3 + (-(x10 - x30)^2 * (8 * y30 * y10 *
z10 * z30 - 4 * y30 * y10 * x30^2 - 4 * y10 * y30 * z10^2 - 4 * y10 *
y30 * x10^2 - 4 * y30 * y10 * z30^2 + x30^4 + y30^4 + z30^4 + x10^4 +
y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2 * x30^2 * z10^2 + 2 * y30^2 *
z30^2 + 2 * y30^2 * x10^2 + 6 * y30^2 * y10^2 + 2 * y30^2 * z10^2 + 2 *
z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 * z30^2 * z10^2 + 2 * x10^2 *
y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 * z10^2 - 16 * y10^2 - 16 * z10^2
- 16 * y30^2 - 16 * z30^2 - 4 * y30^2 * z30 * z10 - 4 * z30 * y10^2 *
z10 + 32 * z30 * z10 - 4 * y30 * y10^3 + 32 * y30 * y10 - 4 * z30 * z10
* x10^2 - 4 * z30 * z10 * x30^2 - 4 * y10 * y30^3 + 2 * x30^2 * y30^2 +
2 * x30^2 * z30^2 - 2 * x30^2 * x10^2 - 4 * z30^3 * z10 - 4 * z10^3 *
z30) - 2 * (x10 - x30) * (-y30 + y10) * (-4 * y10 * x30 * x10^2 - 4 *
x10 * y30^3 - 4 * y30 * x10 * x30^2 + 8 * y10 * x10 * x30^2 + 32 * x30 *
y10 - 4 * x30 * y10 * y30^2 - 4 * y30 * x10 * z30^2 - 4 * x30 * y10 *
z30^2 + 8 * y30 * x30 * x10^2 - 32 * y30 * x30 - 4 * x10 * y30 * z10^2 -
4 * y10 * x30 * z10^2 - 4 * x10 * y30 * y10^2 - 32 * y10 * x10 - 4 * x30
* y10^3 + 8 * y10 * x10 * y30^2 + 8 * x30 * y10 * z10 * z30 + 32 * y30 *
x10 - 4 * y10 * x30^3 + 8 * y30 * x30 * y10^2 - 4 * y30 * x10^3 + 8 *
y30 * x10 * z10 * z30) - (-y30 + y10)^2 * (x30^4 + y30^4 + z30^4 + x10^4
+ y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2 * x30^2 * z10^2 + 2 * y30^2 *
z30^2 + 2 * y30^2 * x10^2 - 2 * y30^2 * y10^2 + 2 * y30^2 * z10^2 + 2 *
z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 * z30^2 * z10^2 + 2 * x10^2 *
y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 * z10^2 - 4 * x30^3 * x10 + 32 *
x10 * x30 - 4 * x10^3 * x30 + 8 * z30 * z10 * x10 * x30 - 16 * x10^2 -
16 * z10^2 - 16 * x30^2 - 16 * z30^2 - 4 * y30^2 * z30 * z10 - 4 * z30 *
y10^2 * z10 + 32 * z30 * z10 - 4 * z30 * z10 * x10^2 - 4 * z30 * z10 *
x30^2 + 2 * x30^2 * y30^2 + 2 * x30^2 * z30^2 + 6 * x30^2 * x10^2 - 4 *
z30^3 * z10 - 4 * z10^3 * z30 - 4 * y30^2 * x10 * x30 - 4 * z30^2 * x10
* x30 - 4 * y10^2 * x30 * x10 - 4 * z10^2 * x30 * x10)) * slope^2 +
(-(x10 - x30)^2 * (-4 * y10 * x30 * x10^2 - 4 * x10 * y30^3 - 4 * y30 *
x10 * x30^2 + 8 * y10 * x10 * x30^2 + 32 * x30 * y10 - 4 * x30 * y10 *
y30^2 - 4 * y30 * x10 * z30^2 - 4 * x30 * y10 * z30^2 + 8 * y30 * x30 *
x10^2 - 32 * y30 * x30 - 4 * x10 * y30 * z10^2 - 4 * y10 * x30 * z10^2 -
4 * x10 * y30 * y10^2 - 32 * y10 * x10 - 4 * x30 * y10^3 + 8 * y10 * x10
* y30^2 + 8 * x30 * y10 * z10 * z30 + 32 * y30 * x10 - 4 * y10 * x30^3 +
8 * y30 * x30 * y10^2 - 4 * y30 * x10^3 + 8 * y30 * x10 * z10 * z30) - 2
* (x10 - x30) * (-y30 + y10) * (x30^4 + y30^4 + z30^4 + x10^4 + y10^4 +
z10^4 + 2 * x30^2 * y10^2 + 2 * x30^2 * z10^2 + 2 * y30^2 * z30^2 + 2 *
y30^2 * x10^2 - 2 * y30^2 * y10^2 + 2 * y30^2 * z10^2 + 2 * z30^2 *
x10^2 + 2 * z30^2 * y10^2 + 6 * z30^2 * z10^2 + 2 * x10^2 * y10^2 + 2 *
x10^2 * z10^2 + 2 * y10^2 * z10^2 - 4 * x30^3 * x10 + 32 * x10 * x30 - 4
* x10^3 * x30 + 8 * z30 * z10 * x10 * x30 - 16 * x10^2 - 16 * z10^2 - 16
* x30^2 - 16 * z30^2 - 4 * y30^2 * z30 * z10 - 4 * z30 * y10^2 * z10 +
32 * z30 * z10 - 4 * z30 * z10 * x10^2 - 4 * z30 * z10 * x30^2 + 2 *
x30^2 * y30^2 + 2 * x30^2 * z30^2 + 6 * x30^2 * x10^2 - 4 * z30^3 * z10
- 4 * z10^3 * z30 - 4 * y30^2 * x10 * x30 - 4 * z30^2 * x10 * x30 - 4 *
y10^2 * x30 * x10 - 4 * z10^2 * x30 * x10)) * slope - (x10 - x30)^2 *
(x30^4 + y30^4 + z30^4 + x10^4 + y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2 *
x30^2 * z10^2 + 2 * y30^2 * z30^2 + 2 * y30^2 * x10^2 - 2 * y30^2 *
y10^2 + 2 * y30^2 * z10^2 + 2 * z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 *
z30^2 * z10^2 + 2 * x10^2 * y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 *
z10^2 - 4 * x30^3 * x10 + 32 * x10 * x30 - 4 * x10^3 * x30 + 8 * z30 *
z10 * x10 * x30 - 16 * x10^2 - 16 * z10^2 - 16 * x30^2 - 16 * z30^2 - 4
* y30^2 * z30 * z10 - 4 * z30 * y10^2 * z10 + 32 * z30 * z10 - 4 * z30 *
z10 * x10^2 - 4 * z30 * z10 * x30^2 + 2 * x30^2 * y30^2 + 2 * x30^2 *
z30^2 + 6 * x30^2 * x10^2 - 4 * z30^3 * z10 - 4 * z10^3 * z30 - 4 *
y30^2 * x10 * x30 - 4 * z30^2 * x10 * x30 - 4 * y10^2 * x30 * x10 - 4 *
z10^2 * x30 * x10))^(1/2) - z30 * (-(-y30 + y10)^2 * (8 * y30 * y10 *
z10 * z30 - 4 * y30 * y10 * x30^2 - 4 * y10 * y30 * z10^2 - 4 * y10 *
y30 * x10^2 - 4 * y30 * y10 * z30^2 + x30^4 + y30^4 + z30^4 + x10^4 +
y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2 * x30^2 * z10^2 + 2 * y30^2 *
z30^2 + 2 * y30^2 * x10^2 + 6 * y30^2 * y10^2 + 2 * y30^2 * z10^2 + 2 *
z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 * z30^2 * z10^2 + 2 * x10^2 *
y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 * z10^2 - 16 * y10^2 - 16 * z10^2
- 16 * y30^2 - 16 * z30^2 - 4 * y30^2 * z30 * z10 - 4 * z30 * y10^2 *
z10 + 32 * z30 * z10 - 4 * y30 * y10^3 + 32 * y30 * y10 - 4 * z30 * z10
* x10^2 - 4 * z30 * z10 * x30^2 - 4 * y10 * y30^3 + 2 * x30^2 * y30^2 +
2 * x30^2 * z30^2 - 2 * x30^2 * x10^2 - 4 * z30^3 * z10 - 4 * z10^3 *
z30) * slope^4 + (-2 * (x10 - x30) * (-y30 + y10) * (8 * y30 * y10 * z10
* z30 - 4 * y30 * y10 * x30^2 - 4 * y10 * y30 * z10^2 - 4 * y10 * y30 *
x10^2 - 4 * y30 * y10 * z30^2 + x30^4 + y30^4 + z30^4 + x10^4 + y10^4 +
z10^4 + 2 * x30^2 * y10^2 + 2 * x30^2 * z10^2 + 2 * y30^2 * z30^2 + 2 *
y30^2 * x10^2 + 6 * y30^2 * y10^2 + 2 * y30^2 * z10^2 + 2 * z30^2 *
x10^2 + 2 * z30^2 * y10^2 + 6 * z30^2 * z10^2 + 2 * x10^2 * y10^2 + 2 *
x10^2 * z10^2 + 2 * y10^2 * z10^2 - 16 * y10^2 - 16 * z10^2 - 16 * y30^2
- 16 * z30^2 - 4 * y30^2 * z30 * z10 - 4 * z30 * y10^2 * z10 + 32 * z30
* z10 - 4 * y30 * y10^3 + 32 * y30 * y10 - 4 * z30 * z10 * x10^2 - 4 *
z30 * z10 * x30^2 - 4 * y10 * y30^3 + 2 * x30^2 * y30^2 + 2 * x30^2 *
z30^2 - 2 * x30^2 * x10^2 - 4 * z30^3 * z10 - 4 * z10^3 * z30) - (-y30 +
y10)^2 * (-4 * y10 * x30 * x10^2 - 4 * x10 * y30^3 - 4 * y30 * x10 *
x30^2 + 8 * y10 * x10 * x30^2 + 32 * x30 * y10 - 4 * x30 * y10 * y30^2 -
4 * y30 * x10 * z30^2 - 4 * x30 * y10 * z30^2 + 8 * y30 * x30 * x10^2 -
32 * y30 * x30 - 4 * x10 * y30 * z10^2 - 4 * y10 * x30 * z10^2 - 4 * x10
* y30 * y10^2 - 32 * y10 * x10 - 4 * x30 * y10^3 + 8 * y10 * x10 * y30^2
+ 8 * x30 * y10 * z10 * z30 + 32 * y30 * x10 - 4 * y10 * x30^3 + 8 * y30
* x30 * y10^2 - 4 * y30 * x10^3 + 8 * y30 * x10 * z10 * z30)) * slope^3
+ (-(x10 - x30)^2 * (8 * y30 * y10 * z10 * z30 - 4 * y30 * y10 * x30^2 -
4 * y10 * y30 * z10^2 - 4 * y10 * y30 * x10^2 - 4 * y30 * y10 * z30^2 +
x30^4 + y30^4 + z30^4 + x10^4 + y10^4 + z10^4 + 2 * x30^2 * y10^2 + 2 *
x30^2 * z10^2 + 2 * y30^2 * z30^2 + 2 * y30^2 * x10^2 + 6 * y30^2 *
y10^2 + 2 * y30^2 * z10^2 + 2 * z30^2 * x10^2 + 2 * z30^2 * y10^2 + 6 *
z30^2 * z10^2 + 2 * x10^2 * y10^2 + 2 * x10^2 * z10^2 + 2 * y10^2 *
z10^2 - 16 * y10^2 - 16 * z10^2 - 16 * y30^2 - 16 * z30^2 - 4 * y30^2 *
z30 * z10 - 4 * z30 * y10^2 * z10 + 32 * z30 * z10 - 4 * y30 * y10^3 +
32 * y30 * y10 - 4 * z30 * z10 * x10^2 - 4 * z30 * z10 * x30^2 - 4 * y10
* y30^3 + 2 * x30^2 * y30^2 + 2 * x30^2 *

Subject: question for increase the speed of solve syntax

From: mahdi roozbhani

Date: 30 Dec, 2010 13:42:04

Message: 3 of 4

thanx dude, but the problem is that the constants in this solve equation are changed.because this solve function has put in for loop and I need the constants in variable mode.

Subject: question for increase the speed of solve syntax

From: Steven_Lord

Date: 3 Jan, 2011 15:54:13

Message: 4 of 4



"mahdi roozbhani" <m.m.roozbahani@gmail.com> wrote in message
news:ifhh7k$2te$1@fred.mathworks.com...
> matlab calculates the below code in very long time. Do u have any idea for
> decreasing the time's implementation of this code ?
>
>
> secondsolve=solve('(x20-x10)^2+(y20-y10)^2+(znn-z10)^2=4','(x20-x30)^2+(y20-y30)^2+(znn-z30)^2=4','-slope*x20+y20=0','znn','x20','y20');

Define variables x10, y10, z10, x30, y30, z30, and slope prior to running
the code. Then specify the inputs to SOLVE as symbolic expressions instead
of strings.

syms znn x20 y20
% define x10 etc.

secondsolve=solve((x20-x10)^2+(y20-y10)^2+(znn-z10)^2-4,(x20-x30)^2+(y20-y30)^2+(znn-z30)^2-4,-slope*x20+y20,znn,x20,y20);

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlab.wikia.com/wiki/FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us