math docs
    Preparing search index...

    Function solve

    • Solves the chain for target, iterating until it is close enough, stops improving, or runs out of attempts.

      A constrained chain does not converge monotonically, so the best pose seen is kept and restored.

      A dead-straight chain is the worst case to solve cold: every direction lies on one line, leaving nothing sideways to bend it with. Give it a slight bend if the first solve matters.

      Parameters

      • chain: Chain3

        the chain to solve, mutated in place

      • target: readonly [number, number, number]

        where the end effector should go

      Returns number

      the distance from the effector to target, also stored as chain.solveDistance