comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Quaternion spherical interpolation in PV-Wave
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Quaternion spherical interpolation in PV-Wave [message #63539] Tue, 11 November 2008 23:34
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Nov 11, 5:18 pm, ez5...@gmail.com wrote:
> I have been been a user of PV-Wave for the last seven years. Let me
> say here that without this newsgroup's help, I probably wouldn't have
> lasted seven months. I've learned a great deal from all the valuable
> posts and been inspired to implement many routines. It's time to
> donate back.
> PV-Wave doesn't have any quaternion routines. Craig Markwardt does.
> I've implemented his routines, but the only one that needed some
> tweaking was QTERP. Thanks to Craig for validating my results.

Hello, I think I recognize you, based on the subject of your post.
Thanks for your contribution! I'm glad the general algorithm could
work for PV-WAVE, and you contributed your results back to the
community. In a way, though, I'm kind of sad that the function was
completely re-written, when only a few lines really changed. A few
comments below.

Craig


> function qterp, t0,q0,t1,qdiff=qdiff,reset=reset,slerp=slerp
> ; This function has been modified for implementation
> ; in PV-Wave from the original written by Craig Markwardt.
> ; Many thanks to him for his help verifying this implementation.
> ; All other quaternion routines are as originally written.
> nq=n_elements(q0)/4
> if nq eq 0 then begin
> print,'no q input, stopping...'
> return, -1
> endif
> if nq eq 1 then return,rebin(reform(q0,4,1),4,n_elements(t1))
> if keyword_set(slerp) then begin
> if n_elements(qdiff)/4 ne nq-1 or keyword_set(reset) then begin
> qdiff=qtmult(q0(*,0:nq-2),/inv,q0(*,1:*))
;; QTMULT actually has /INV1 and /INV2 keywords, should be /INV1
> wh=where(qdiff(3,*) lt 0,ct)
> if ct gt 0 then qdiff(*,wh)=qdiff(*,wh)
;; Above line was mis-translated, should be,
;; if ct gt 0 then qdiff(*,wh)=-qdiff(*,wh)
> endif
> ii=floor(mgh_locate(t0,xout=t1)) < (nq-2) > 0 ; mark hadfield
> hh=(t1-t0(ii)/(t0(ii+1)-t0(ii))
> return,qtmult(q0(*,ii),qtpow(qdiff(*,ii),hh))
> endif
> q1=(q0(*,0)#t1)*0
> for i=0,3 do q1(i,*)=spline(t0,q0(i,*),t1)
> tot=sqrt(total(q1^2,d=0))
> for i=0,3 do q1(i,*)=q1(i,*)/tot
> return,q1
> end
>
> Regards,
> SpinMan
[Message index]
 
Read Message
Previous Topic: 2-d fitting
Next Topic: SCHOOL LOAN

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 13:43:21 PDT 2025

Total time taken to generate the page: 1.11820 seconds