//兩點之間的距離 let dx:number = this.targetX - this.ball.x; let dy:number = this.targetY - this.ball.y; let distance:number = Math.sqrt(dx*dx+dy*dy); console.info(distance);