Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Using Solve/FSolve for Multiple Trig Equations
Replies: 7   Last Post: May 4, 2013 8:44 AM

 Messages: [ Previous | Next ]
 Bruno Luong Posts: 9,822 Registered: 7/26/08
Re: Using Solve/FSolve for Multiple Trig Equations
Posted: May 2, 2013 3:22 AM

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <klrqr9\$k14\$1@newscl01ah.mathworks.com>...
> Alan_Weiss <aweiss@mathworks.com> wrote in message
> > [ snip]
> >
> > So there is no solution to the equations, at least over the reals, and I
> > think even over complex, too.

>
> There is solution(s) only if I^2 + J^2 + Z^2 = 1. And if there is one solution, there is an infinity of them, see my post.
>

Here is a short code to illustrate that the problem of finding 3D rotation matrix R such that R*u = v has infinity solutions:

% Input vectors of norm 1
u = rand(3,1);
u = u/norm(u)
v = randn(3,1) ;
v = v/norm(v);

% (Random) Rotation solution of (R*u) = v
w = 0.5*(u + v);
q = cross(u,v);
r = randn(); % free parameter, any number will work
q = q + r*w;
q = q / norm(q);
d = dot(u, q);
c = q*d;

u1 = u-c;
u1 = u1/norm(u1);
v1 = v-c;
v1 = v1/norm(v1);
% Rodrigues's formula:
k = cross(u1, v1);
costheta = dot(u1,v1);
R =[ 0 -k(3) k(2);
k(3) 0 -k(1);
-k(2) k(1) 0];
R = costheta*eye(3) + R + k*k'*(1-costheta)/sum(k.^2);

% Check
disp(R)
disp(R*u) % close to v

% Bruno

Date Subject Author
5/1/13 Jung
5/1/13 Nasser Abbasi
5/1/13 Alan Weiss
5/1/13 Bruno Luong
5/2/13 Bruno Luong
5/2/13 Bruno Luong
5/4/13 Bruno Luong
5/1/13 Bruno Luong