preet
- 96
- 0
This isn't really a homework question, but may be similar to a typical example problem so I posted it here.
I want to find the max and min dot product of a 3d vector and all points in a sphere constrained by angles in spherical coordinates.
A point on the sphere can be expressed using spherical parameters (R is constant) as:
x=R*sin\theta*cos\phi
y=R*sin\theta*sin\phi
z=R*cos\theta
The dot product between any point on the sphere and a vector [A,B,C] can be written as:
f(\theta,\phi) = A*R*sin\theta*cos\phi + B*R*sin\theta*sin\phi + R*cos\theta
We can set some constraint \theta = \theta_A on f and then find the extrema to find the max and min.
From Wikipedia, I can set up Lagrange Multipliers with my function and the constraint using
\Lambda(x,y,\lambda) = f(x,y) + \lambda \cdot \Big(g(x,y)-c\Big),
and solve
\nabla_{x,y,\lambda} \Lambda(x , y, \lambda)=0.
The problem is I'm not sure how to set up the gradient. I know that the gradient has a slightly different definition in spherical coordinates. Which definition of the gradient should I be using here?
Homework Statement
I want to find the max and min dot product of a 3d vector and all points in a sphere constrained by angles in spherical coordinates.
Homework Equations
A point on the sphere can be expressed using spherical parameters (R is constant) as:
x=R*sin\theta*cos\phi
y=R*sin\theta*sin\phi
z=R*cos\theta
The Attempt at a Solution
The dot product between any point on the sphere and a vector [A,B,C] can be written as:
f(\theta,\phi) = A*R*sin\theta*cos\phi + B*R*sin\theta*sin\phi + R*cos\theta
We can set some constraint \theta = \theta_A on f and then find the extrema to find the max and min.
From Wikipedia, I can set up Lagrange Multipliers with my function and the constraint using
\Lambda(x,y,\lambda) = f(x,y) + \lambda \cdot \Big(g(x,y)-c\Big),
and solve
\nabla_{x,y,\lambda} \Lambda(x , y, \lambda)=0.
The problem is I'm not sure how to set up the gradient. I know that the gradient has a slightly different definition in spherical coordinates. Which definition of the gradient should I be using here?