Path: news.mathworks.com!newsfeed-00.mathworks.com!news.tele.dk!feed118.news.tele.dk!feed116.news.tele.dk!bofh.vszbr.cz!news.radio.cz!newsreader4.netcologne.de!news.netcologne.de!news.swapon.de!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: someone <newsboost@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Matlab - transformation matrix - what is wrong?
Date: Wed, 23 Nov 2011 14:46:18 +0100
Organization: A noiseless patient Spider
Lines: 71
Message-ID: <4ECCF92A.8020308@gmail.com>
References: <ja3d4u$o8j$1@dont-email.me> <ja3hvg$2to$1@newscl01ah.mathworks.com> <ja55if$3uf$1@dont-email.me> <ja5tit$r9n$1@newscl01ah.mathworks.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: mx04.eternal-september.org; posting-host="wTlquPdqdQnoU4V3MLCRlw";
	logging-data="12516"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+MDWi3V9H8zUdIUVS3CMpSjqmZIENvDTU="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1
In-Reply-To: <ja5tit$r9n$1@newscl01ah.mathworks.com>
Cancel-Lock: sha1:k9stwhjabN/7PAwMmgUfdpO9vdk=
Xref: news.mathworks.com comp.soft-sys.matlab:750209

On 2011-11-18 16:28, Matt J wrote:
> someone <newsboost@gmail.com> wrote in message
> <ja55if$3uf$1@dont-email.me>...
>>
>> I only demand that yvec is a unit vector (like xvec) and that yvec is
>> orthogonal to xvec - even though I cannot solve this problem, I cannot
>> believe it should be difficult for a clever guy (like those in this
>> forum) :-)
> ===================
>
> If that's all you require, why not use two cross products, as follows

The truth? Because I'm apparantly too stupid, thank you :-)

> if ~isequal(xvec,[1 0 0])
>
> yvec=cross(xvec,[1 0 0]); zvec=cross(xvec,yvec);
>
> else %xvec is just the standard x-axis basis vector,
>
> yvec=[0 1 0];
> zvec=[0 0 1];
>
> end

I'm terribly sorry for the late answer. I had been travelling just 
before I asked the question and then I came back, started doing too many 
things and for a few days I forgot I had asked here (ofcourse I 
remembered it, when I sat down at looked at this problem again). I'm 
sorry. Next: Thank you very much!


However, I don't understand this:

On 2011-11-18 17:04, Matt J wrote:
 > "Matt J" wrote in message <ja5tit$r9n$1@newscl01ah.mathworks.com>...
 >>
 >> If that's all you require, why not use two cross products, as follows
 >>
 >> if ~isequal(xvec,[1 0 0])
 > ===============
 >
 > That should be
 >
 > if norm(xvec,[1,0,0])
 >
 > And, obviously, you may want to modify the code to account for the cases
 > where xvec is very close to the x-axis, but doesn't coincide with it.

I don't understand your second point:

K>> norm(xvec,[1,0,0])
??? Error using ==> norm
The only matrix norms available are 1, 2, inf, and 'fro'.

---------------------

Here's what I think you might have had in mind?

         if all(xvec == crossProdVec)
             yvec = [0 1 0];
             zvec = [0 0 1];
         else
             yvec = cross(xvec,crossProdVec);
             zvec = cross(xvec,yvec);
         end


But it works fine - THANKS!

(sorry again for late answer)