code: function (px, py, radius) {
          var cx = 0;
          var cy = 0;
          var dx = cx - px;
          var dy = cy - py;
          var dd = Math.sqrt(dx * dx + dy * dy);
          var a = Math.asin(radius / dd);
          var b = Math.atan2(dy, dx);
          var t1 = b - a;
          var t2 = b + a;
          return {
              p1: [radius * Math.sin(t1), radius * -Math.cos(t1)],
              p2: [radius * -Math.sin(t2), radius * Math.cos(t2)],
              center: [-radius * Math.cos(b), radius * -Math.sin(b)],
              arclength: 2 * a
          };
      }
docs: Calculates the tangent from a point to a circle.