I have a circle that is given by $ \begin{cases} (x-3)^2 + (y-4)^2 + z^2 = 36\\ 4x + y - z - 9 = 0 \end{cases} $ , and i need to take a point that belongs to this circle. Is there an easier way in general to find a point without randomly try to pick $x,y$ and $z$ until somehow they fit the equation?
Picking a random point from a circle in 3D
212 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail AtThere are 5 best solutions below
On
There are many ways to do that, but I think fundamentally they are doing the same thing. One way to do it: you can do a rotation, translation, scaling so that the plane becomes e.g. the $x$-$y$ plane, and the sphere becomes the unit sphere. Then sample a point in the 2-d unit circle (in your example, the circle could be $\{(x, y, z): z = 0,\,x^2 + y^2 = 1\}$) by e.g. sample an angle. After you get a sample, to the reverse rotation, translation, scaling to get a sample from the original circle.
On
You can use the standard $r, \phi, \theta$ transformation, and you'll have a "cube", where all values within it are within your sphere. This way you choose $x,y,z$ in your ranges.
On
Essentially you still need to solve the system of equations to find the two variables in terms of the other variable.
From the second equation we have $z=4x+y-9$ and substituting into the first gives
$$(x-3)^2+(y-4)^2+(4x+y-9)^2=36$$ $$\implies 2y^2+(8x-26)y+17x^2-78x+70=0.$$
Then fixing $x=c$ we obtain a quadratic for $y$, and applying the quadratic formula we have
$$y=\frac{1}{2}\left(\pm\sqrt{-18c^2+52c+29}-4c+13\right)$$
and substituting in $z$ gives $$z = \frac{1}{2}\left(\pm\sqrt{-18c^2+52c+29}+4c-5\right)$$
Note that $-18c^2+52c+29\geq0\iff\frac{1}{18}(26-\sqrt{1198}) (\approx -0.478)\leq c\leq \frac{1}{18}(26+\sqrt{1198})( \approx 3.367),$ which is the range of values of $x$ for which you have real solutions.
Thus choosing any $x=c$ for $c$ in the given range above, you can obtain $y$ and $z$ by substituting.
On
We know that $n={(4,1,-1)\over3\sqrt{2}}$ is the unit vector normal to the plane. We can choose two perpendicular unit vectors parallel to the plane as follows: $$ u={(-1,4,0)\over\sqrt{17}},\quad v=n\times u={(-4,1,17)\over3\sqrt{34}}. $$ The center $C$ of the circle is that point on the plane which is nearest to the center $(3,4,0)$ of the sphere: $$ C=\left({13\over9},{65\over18},{7\over18}\right). $$ Pythagoras' theorem gives then the radius of the circle: $$ r=\sqrt{599\over18}. $$
It follows that a generic point on the circle can be parameterised as: $$ P=C+ru\cos t+rv\sin t,\quad t\in[0,2\pi). $$
For a uniform distribution, just pick $t$ uniformly at random and substitute into the above formula.
Personally, I use wolframalpha.com for equations like this. Actually, a better equation to input is this.
What you're looking for is something like $f(x)=y$ and $f(x,y)=z$.
Here's how I approach this specific system of equations:
This means that z can be any value from -6 to 6, y any value from -2 to 10, and x any value from -3 to 9. This is called the "domain" of the surface.
$(x-3)^2 + (y-4)^2 + (4x + y - 9)^2 = 36$
another way to write this is:
$17 x^2 + x (8 y - 78) + 2 y^2 - 26 y = -70$
I can also solve for y, so that I have y=f(x):
$y = f(x) = 0.5(-sqrt(-18x^2 + 52x + 29) - 4x + 13)$
I can also solve the first equation for z, so that I have z=f(x,y):
$z = sqrt(-1((x-3)^2 + (y-4)^2 - 36))$
All I did was I took the second equation, solved for z, and substituted back into the first equation. Then I simplified, then I solved for y.
It's also important to realize that I could have solved your second equation for x or y as well, and then substituted that back into the first equation. I just picked z because it had no coefficients so it was easier to solve for.
Find the roots of $-18x^2 + 52x + 29$:
$x = 1/18 (26 (+/-) sqrt(1198))$
This means x can be anywhere between $(26 - sqrt(1198))/18$ and $(26 + sqrt(1198))/18$.
To find a value to pick, I'll just use $x = (26 + 10)/18 = 36/18 = 2$.
In summary, what I did was: