cpvslerpconst   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/contrib/libchipmunk/cpVect.xtm

Implementation

(bind-func cpvslerpconst
  (lambda (v1:cpVect v2:cpVect a:cpFloat)
    (let (
        (dot (cpvdot (cpvnormalize v1) (cpvnormalize v2)))
        (omega (acos (clamp dot -1. 1.))))
      (cpvslerp v1 v2 (/ (min a omega) omega)))))


Back to Index