cpTransformAxialScale   xtlang


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

Implementation

(bind-func cpTransformAxialScale
  (lambda (axis:cpVect pivot:cpVect scale:cpFloat)
    (let (
        (A (* (tref axis 0) (tref axis 1) (- scale 1.)))
        (B (* (cpvdot axis pivot) (- 1.0 scale))))
      (cpTransformNewTranspose
        (+ (* scale (tref axis 0) (tref axis 0)) (* (tref axis 1) (tref axis 1)))
        A
        (* (tref axis 0) B)
        A
        (+ (* (tref axis 0) (tref axis 0)) (* scale (tref axis 1) (tref axis 1)))
        (* (tref axis 1) B)))))


Back to Index