Skip to main content
deleted 42 characters in body
Source Link
John R Ramsden
  • 1.5k
  • 13
  • 20

You'll almost certainly find that sampling the parameters uniformly will not sample points uniformly on the intersection.

But a general parametrization, involving Jacobian elliptic functions, can be found inductively as follows (where for convenience I denote $ a_i = 1 / \lambda_i $).

Let $x_1 = 1 + p$ and, for $i > 1$, $x_i = p q_i $. Plugging these into the n-sphere gives either $p = 0$, which may or may not lead to a point in the intersection, or $p = -2 / ( 1 + q_2^2 + .. + q_n^2 )$.

Plugging the second equation for p into the $x_i$, and these into the ellipsoid, gives the remaining condition as follows, denoting $r^2 := q_2^2 + .. + q_n^2 $ :

$ a_1^2 (r^2 - 1)^2 + 4 a_2^2 q_2^2 + .. + 4 a_n^2 q_n^2 = (r^2 + 1)^2 $

Denoting $ s^2 := ((r^2 + 1)/2)^2 - a_1^2((r^2 - 1)/2)^2 $ and $ y_i := q_i / r$, these become:

$ y_2^2 + .. + y_n^2 = 1$

$ (a_2 \frac{r}{s} y_2)^2 + .. + (a_n \frac{r}{s} y_n)^2 = 1$

Noting that $r^2 = (\frac{r^2 + 1}{2})^2 - (\frac{r^2 - 1}{2})^2 $ identically, we see that $r$ and $s$ must satisfy:

$ \frac{r^2 - 1}{r^2 + 1} = sn(a_1, u) $

$ \frac{2 r}{r^2 + 1} = cn(a_1, u) $

$ \frac{2 s}{r^2 + 1} = dn(a_1, u) $

giving:

$ r = \frac{dn (1 + cn + sn)}{cn (1 + cn - sn)} $

$ s = \frac{1 + cn + sn}{1 + cn - sn} $

Finally, when you get down to:

$ z_{n-1}^2 + z_n^2 = 1$

$ (a_{n-1} z_{n-1})^2 + (a_n z_n)^2 = 1 $

you can treat this as a pair of course parametrizelinear equations in $z_{n-1}$$z_{n-1}^2$ and $z_n$ directly in terms of Jacobian elliptic functions with modulus $a_n$$z_n^2$.

Regards

John R Ramsden

You'll almost certainly find that sampling the parameters uniformly will not sample points uniformly on the intersection.

But a general parametrization, involving Jacobian elliptic functions, can be found inductively as follows (where for convenience I denote $ a_i = 1 / \lambda_i $).

Let $x_1 = 1 + p$ and, for $i > 1$, $x_i = p q_i $. Plugging these into the n-sphere gives either $p = 0$, which may or may not lead to a point in the intersection, or $p = -2 / ( 1 + q_2^2 + .. + q_n^2 )$.

Plugging the second equation for p into the $x_i$, and these into the ellipsoid, gives the remaining condition as follows, denoting $r^2 := q_2^2 + .. + q_n^2 $ :

$ a_1^2 (r^2 - 1)^2 + 4 a_2^2 q_2^2 + .. + 4 a_n^2 q_n^2 = (r^2 + 1)^2 $

Denoting $ s^2 := ((r^2 + 1)/2)^2 - a_1^2((r^2 - 1)/2)^2 $ and $ y_i := q_i / r$, these become:

$ y_2^2 + .. + y_n^2 = 1$

$ (a_2 \frac{r}{s} y_2)^2 + .. + (a_n \frac{r}{s} y_n)^2 = 1$

Noting that $r^2 = (\frac{r^2 + 1}{2})^2 - (\frac{r^2 - 1}{2})^2 $ identically, we see that $r$ and $s$ must satisfy:

$ \frac{r^2 - 1}{r^2 + 1} = sn(a_1, u) $

$ \frac{2 r}{r^2 + 1} = cn(a_1, u) $

$ \frac{2 s}{r^2 + 1} = dn(a_1, u) $

giving:

$ r = \frac{dn (1 + cn + sn)}{cn (1 + cn - sn)} $

$ s = \frac{1 + cn + sn}{1 + cn - sn} $

Finally, when you get down to:

$ z_{n-1}^2 + z_n^2 = 1$

$ (a_{n-1} z_{n-1})^2 + (a_n z_n)^2 = 1 $

you can of course parametrize $z_{n-1}$ and $z_n$ directly in terms of Jacobian elliptic functions with modulus $a_n$.

Regards

John R Ramsden

You'll almost certainly find that sampling the parameters uniformly will not sample points uniformly on the intersection.

But a general parametrization, involving Jacobian elliptic functions, can be found inductively as follows (where for convenience I denote $ a_i = 1 / \lambda_i $).

Let $x_1 = 1 + p$ and, for $i > 1$, $x_i = p q_i $. Plugging these into the n-sphere gives either $p = 0$, which may or may not lead to a point in the intersection, or $p = -2 / ( 1 + q_2^2 + .. + q_n^2 )$.

Plugging the second equation for p into the $x_i$, and these into the ellipsoid, gives the remaining condition as follows, denoting $r^2 := q_2^2 + .. + q_n^2 $ :

$ a_1^2 (r^2 - 1)^2 + 4 a_2^2 q_2^2 + .. + 4 a_n^2 q_n^2 = (r^2 + 1)^2 $

Denoting $ s^2 := ((r^2 + 1)/2)^2 - a_1^2((r^2 - 1)/2)^2 $ and $ y_i := q_i / r$, these become:

$ y_2^2 + .. + y_n^2 = 1$

$ (a_2 \frac{r}{s} y_2)^2 + .. + (a_n \frac{r}{s} y_n)^2 = 1$

Noting that $r^2 = (\frac{r^2 + 1}{2})^2 - (\frac{r^2 - 1}{2})^2 $ identically, we see that $r$ and $s$ must satisfy:

$ \frac{r^2 - 1}{r^2 + 1} = sn(a_1, u) $

$ \frac{2 r}{r^2 + 1} = cn(a_1, u) $

$ \frac{2 s}{r^2 + 1} = dn(a_1, u) $

giving:

$ r = \frac{dn (1 + cn + sn)}{cn (1 + cn - sn)} $

$ s = \frac{1 + cn + sn}{1 + cn - sn} $

Finally, when you get down to:

$ z_{n-1}^2 + z_n^2 = 1$

$ (a_{n-1} z_{n-1})^2 + (a_n z_n)^2 = 1 $

you can treat this as a pair of linear equations in $z_{n-1}^2$ and $z_n^2$.

Regards

John R Ramsden

added 24 characters in body; edited body
Source Link
John R Ramsden
  • 1.5k
  • 13
  • 20

You'll almost certainly find that sampling the parameters uniformly will not sample points uniformly on the intersection.

But a general parametrization, involving Jacobian elliptic functions, can be found inductively as follows (where for convenience I denote $ a_i = 1 / \lambda_i $).

Let $x_1 = 1 + p$ and, for $i > 1$, $x_i = p q_i $. Plugging these into the n-sphere gives either $p = 0$, which may or may not lead to a point in the intersection, or $p = -2 / ( 1 + q_2^2 + .. + q_n^2 )$.

Plugging the second equation for p into the $x_i$, and these into the ellipsoid, gives the remaining condition as follows, denoting $r^2 := q_2^2 + .. + q_n^2 $ :

$ a_1^2 (r^2 - 1)^2 + 4 a_2^2 q_2^2 + .. + 4 a_n^2 q_n^2 = (r^2 + 1)^2 $

Denoting $ s^2 := ((r^2 + 1)/2)^2 - a_1^2((r^2 - 1)/2)^2 $ and $ y_i := q_i / r$, these become:

$ y_2^2 + .. + y_n^2 = 1$

$ (a_2 y_2)^2 + .. + (a_n y_n)^2 = 1$$ (a_2 \frac{r}{s} y_2)^2 + .. + (a_n \frac{r}{s} y_n)^2 = 1$

Noting that $r^2 = (\frac{r^2 + 1}{2})^2 - (\frac{r^2 - 1}{2})^2 $ identically, we see that $r$ and $s$ must satisfy:

$ \frac{r^2 - 1}{r^2 + 1} = sn(a_1, u) $

$ \frac{2 r}{r^2 + 1} = cn(a_1, u) $

$ \frac{2 s}{r^2 + 1} = dn(a_1, u) $

giving:

$ r = \frac{dn (1 + cn + sn)}{cn (1 + cn - sn)} $

$ s = \frac{1 + cn + sn}{1 + cn - sn} $

Finally, when you get down to:

$ z_{n-1}^2 + z_n^2 = 1$

$ (a_{n-1} z_{n-1})^2 + (a_n z_n)^2 = 1 $

you can of course parametrize $z_{n-1}$ and $z_n$ directly in terms of Jacobian elliptic functions with modulus $a_n$.

Regards

John R Ramsden

You'll almost certainly find that sampling the parameters uniformly will not sample points uniformly on the intersection.

But a general parametrization, involving Jacobian elliptic functions, can be found inductively as follows (where for convenience I denote $ a_i = 1 / \lambda_i $).

Let $x_1 = 1 + p$ and, for $i > 1$, $x_i = p q_i $. Plugging these into the n-sphere gives either $p = 0$, which may or may not lead to a point in the intersection, or $p = -2 / ( 1 + q_2^2 + .. + q_n^2 )$.

Plugging the second equation for p into the $x_i$, and these into the ellipsoid, gives the remaining condition as follows, denoting $r^2 := q_2^2 + .. + q_n^2 $ :

$ a_1^2 (r^2 - 1)^2 + 4 a_2^2 q_2^2 + .. + 4 a_n^2 q_n^2 = (r^2 + 1)^2 $

Denoting $ s^2 := ((r^2 + 1)/2)^2 - a_1^2((r^2 - 1)/2)^2 $ and $ y_i := q_i / r$, these become:

$ y_2^2 + .. + y_n^2 = 1$

$ (a_2 y_2)^2 + .. + (a_n y_n)^2 = 1$

Noting that $r^2 = (\frac{r^2 + 1}{2})^2 - (\frac{r^2 - 1}{2})^2 $ identically, we see that $r$ and $s$ must satisfy:

$ \frac{r^2 - 1}{r^2 + 1} = sn(a_1, u) $

$ \frac{2 r}{r^2 + 1} = cn(a_1, u) $

$ \frac{2 s}{r^2 + 1} = dn(a_1, u) $

giving:

$ r = \frac{dn (1 + cn + sn)}{cn (1 + cn - sn)} $

$ s = \frac{1 + cn + sn}{1 + cn - sn} $

Finally, when you get down to:

$ z_{n-1}^2 + z_n^2 = 1$

$ (a_{n-1} z_{n-1})^2 + (a_n z_n)^2 = 1 $

you can of course parametrize $z_{n-1}$ and $z_n$ directly in terms of Jacobian elliptic functions with modulus $a_n$.

Regards

John R Ramsden

You'll almost certainly find that sampling the parameters uniformly will not sample points uniformly on the intersection.

But a general parametrization, involving Jacobian elliptic functions, can be found inductively as follows (where for convenience I denote $ a_i = 1 / \lambda_i $).

Let $x_1 = 1 + p$ and, for $i > 1$, $x_i = p q_i $. Plugging these into the n-sphere gives either $p = 0$, which may or may not lead to a point in the intersection, or $p = -2 / ( 1 + q_2^2 + .. + q_n^2 )$.

Plugging the second equation for p into the $x_i$, and these into the ellipsoid, gives the remaining condition as follows, denoting $r^2 := q_2^2 + .. + q_n^2 $ :

$ a_1^2 (r^2 - 1)^2 + 4 a_2^2 q_2^2 + .. + 4 a_n^2 q_n^2 = (r^2 + 1)^2 $

Denoting $ s^2 := ((r^2 + 1)/2)^2 - a_1^2((r^2 - 1)/2)^2 $ and $ y_i := q_i / r$, these become:

$ y_2^2 + .. + y_n^2 = 1$

$ (a_2 \frac{r}{s} y_2)^2 + .. + (a_n \frac{r}{s} y_n)^2 = 1$

Noting that $r^2 = (\frac{r^2 + 1}{2})^2 - (\frac{r^2 - 1}{2})^2 $ identically, we see that $r$ and $s$ must satisfy:

$ \frac{r^2 - 1}{r^2 + 1} = sn(a_1, u) $

$ \frac{2 r}{r^2 + 1} = cn(a_1, u) $

$ \frac{2 s}{r^2 + 1} = dn(a_1, u) $

giving:

$ r = \frac{dn (1 + cn + sn)}{cn (1 + cn - sn)} $

$ s = \frac{1 + cn + sn}{1 + cn - sn} $

Finally, when you get down to:

$ z_{n-1}^2 + z_n^2 = 1$

$ (a_{n-1} z_{n-1})^2 + (a_n z_n)^2 = 1 $

you can of course parametrize $z_{n-1}$ and $z_n$ directly in terms of Jacobian elliptic functions with modulus $a_n$.

Regards

John R Ramsden

Source Link
John R Ramsden
  • 1.5k
  • 13
  • 20

You'll almost certainly find that sampling the parameters uniformly will not sample points uniformly on the intersection.

But a general parametrization, involving Jacobian elliptic functions, can be found inductively as follows (where for convenience I denote $ a_i = 1 / \lambda_i $).

Let $x_1 = 1 + p$ and, for $i > 1$, $x_i = p q_i $. Plugging these into the n-sphere gives either $p = 0$, which may or may not lead to a point in the intersection, or $p = -2 / ( 1 + q_2^2 + .. + q_n^2 )$.

Plugging the second equation for p into the $x_i$, and these into the ellipsoid, gives the remaining condition as follows, denoting $r^2 := q_2^2 + .. + q_n^2 $ :

$ a_1^2 (r^2 - 1)^2 + 4 a_2^2 q_2^2 + .. + 4 a_n^2 q_n^2 = (r^2 + 1)^2 $

Denoting $ s^2 := ((r^2 + 1)/2)^2 - a_1^2((r^2 - 1)/2)^2 $ and $ y_i := q_i / r$, these become:

$ y_2^2 + .. + y_n^2 = 1$

$ (a_2 y_2)^2 + .. + (a_n y_n)^2 = 1$

Noting that $r^2 = (\frac{r^2 + 1}{2})^2 - (\frac{r^2 - 1}{2})^2 $ identically, we see that $r$ and $s$ must satisfy:

$ \frac{r^2 - 1}{r^2 + 1} = sn(a_1, u) $

$ \frac{2 r}{r^2 + 1} = cn(a_1, u) $

$ \frac{2 s}{r^2 + 1} = dn(a_1, u) $

giving:

$ r = \frac{dn (1 + cn + sn)}{cn (1 + cn - sn)} $

$ s = \frac{1 + cn + sn}{1 + cn - sn} $

Finally, when you get down to:

$ z_{n-1}^2 + z_n^2 = 1$

$ (a_{n-1} z_{n-1})^2 + (a_n z_n)^2 = 1 $

you can of course parametrize $z_{n-1}$ and $z_n$ directly in terms of Jacobian elliptic functions with modulus $a_n$.

Regards

John R Ramsden