AlmostSwedish
- 7
- 0
Homework Statement
Ok, so I need to differentiate the following
theta = arccos(((r1-r2).(r3-r2))/(||r1-r2||*||r3-r2||))
With regards to r1, r2 and r3
r1, r2 and r3 are three dimensional vectors. "." is the scalar/dot product and * is ordinary multiplication.
Homework Equations
Definition of scalar product: a.b = ||a||*||b||*cos(theta)
Where theta is the angle between the vectors
The Attempt at a Solution
So I figured the chain rule be a good first attemt. The formula looks like this:
theta = f(R) = g(h(R)/k(R))
where I used simply used R instead of r1,r2,r3.
The derivatives then look like
f ' = g'(R)*(h'*k - h*k')
I know that g' = -1/sqrt(1-(h(R)/k(R))2)
The problem is that I'm unsure of how do differentiate the expressions for h and k. The approach I used was as to look at them as function of ordinary variables.
Differentiate with regards to r1:
h' = r0.(r3-r2)
where r0 = (1,1,1) and is the differentiation of r1 with regard to itself (Is this correct?)
In the same way; k' = ||r3-r2||
The expressions for the derivatives with regard to r3 are the same, just replace r1 with r3 (and vice versa)
For the differentiation with regards to r2:
h' = - r0.(r3-r2) - r0.(r1-r2)
k' = - ||r3-r2|| - ||r1-r2||So naturally, my question is if this is correct (and I assume it is not, for I have never done anything like this before)? If not, where did I go wrong?
Thank you for your help.
Last edited: