function computePositionAsLocalOffset(elem, home) {
  if (!home) {
    home = $(homeContainer(elem)).pagexy();
  }
  var totalParentTransform = totalTransform2x2(elem.parentElement),
      inverseParent = inverse2x2(totalParentTransform),
      origin = getTurtleOrigin(elem, inverseParent),
      ts = readTurtleTransform(elem, true),
      localHome = inverseParent && matrixVectorProduct(inverseParent,
          subtractVector([home.pageX, home.pageY], origin)),
      isy = ts && 1 / ts.sy;
  if (!inverseParent) { return; }
  return [(ts.tx - localHome[0]) * isy, (localHome[1] - ts.ty) * isy];
}
// an array of len 2.
an array of len 2.
an array of len 2 .
function computePositionAsLocalOffset(elem, home) {
  if (!home) {
    home = $(homeContainer(elem)).pagexy();
  }
  var totalParentTransform = totalTransform2x2(elem.parentElement),
      inverseParent = inverse2x2(totalParentTransform),
      origin = getTurtleOrigin(elem, inverseParent),
      ts = readTurtleTransform(elem, true),
      localHome = inverseParent && matrixVectorProduct(inverseParent,
          subtractVector([home.pageX, home.pageY], origin)),
      isy = ts && 1 / ts.sy;
  if (!inverseParent) { return; }
  return [(ts.tx - localHome[0]) * isy, (localHome[1] - ts.ty) * isy];
}
function computePositionAsLocalOffset ( elem , home ) { if ( ! home ) { home = $ ( homeContainer ( elem ) ) . pagexy ( ) ; } var totalParentTransform = totalTransform2x2 ( elem . parentElement ) , inverseParent = inverse2x2 ( totalParentTransform ) , origin = getTurtleOrigin ( elem , inverseParent ) , ts = readTurtleTransform ( elem , true ) , localHome = inverseParent && matrixVectorProduct ( inverseParent , subtractVector ( [ home . pageX , home . pageY ] , origin ) ) , isy = ts && 1 / ts . sy ; if ( ! inverseParent ) { return ; } return [ ( ts . tx - localHome [ 0 ] ) * isy , ( localHome [ 1 ] - ts . ty ) * isy ] ; }
an array of len 2.
an array of len 2 .