Currently I am trying to understand how Newtons method works by finding a point that lies on the surface of a sphere.
Currently, my understanding is as follows:
Sphere equation: (x - a)2 + (y - b)2 + (z - c)2 = r2
where a, b, c = center of sphere
where x, y, z = sample location
where r2 = radius squared
Lets say we have a sphere located at (5, 6, 1) and radius 2.
The equation becomes:
(x - 5)2 + (y - 6)2 + (z - 1)2 = 4.
So if we want to know if a point (x, y, z) lies on a sphere, we can start with an initial sampling position:
(s1) = (8, 9, 4)
We now want to find the next position, which we can do with the following equation:
s2 = s1 - (f(s1) / f`(s1))
where (s2) = second sample location (target)
f(s1) = first sample location's equation
f`(s1) = derivative of the sample
So,
f(s1) = (8 - 5)2 + (9 - 6)2 + (4 - 1)2 = 13.24
Now, we need to find the derivative of a sphere, which i think is:
4 * pi * (r * r)
which is
4 * pi * (2 * 2) = 50.26548
So, pluggin everything in, our equation becomes:
s2 = s1 - (13.24 / 50.26548)
which makes the second sample position be:
(7.462852, 8.462852, 3.462852)
I feel like my understanding of this is wrong, since even after 100 iterations, this does not seem to converge to a point where the dot(sample - center) == radius * radius.
Could someone try to explain this to me please?
You are confusing the derivative with area, in higher dimension it's a bit more complicated than what you think, the derivative of the sphere formula is a vector $(2(x-5),2(y-6),2(z-1))$, to use Newton's method you need to compute the inverse of the matrix $Df(s1) = \begin{pmatrix} 2(x-5) & 2(y-6) & 2(z-1) \\ 0 & 1 & 0\\ 0 & 0 & 1 &\end{pmatrix} $ Then apply it to your vector: $$ (s_2,0,0) = (s_1,0,0)-[Df(s_1)]^{-1}(f(s_1),0,0)$$
I'll let more experienced applied mathematicians answer how you get your inverse matrix, since I have 0 experience with that.
Of course, the way to actually get a point on the sphere can be obtained in a simpler manner by considering the retraction: $$ P = (8,9,4)\ \ r=2 \ \ s_1\in \mathbb{R}^3\ \ \ s_2=r\frac{s_1-P}{\|s_1-P\|} + p \in S_r^2(P)$$
Where $$ \| (x,y,z) \| = \sqrt{x^2+y^2+z^2}$$