Typhoon Start JavaScript Fairyland
Our web spider found the following code snippet at home_jlu_edu_cn and contains information about atan and JavaScript.
atan(disty/distx)*180/Math.PI)
if (distx==0 && disty==0) angle = 0
if (this.flower.x>=this.x+8) {
if (this.flower.y<=this.y+8) angle = angle    // 0 to 90
else angle = 360-angle                // 270 to 360
this.direction = "r"
else {
if (this.flower.y<=this.y+8) angle = 180-angle    // 90 to 180
else angle = 180+angle           // 180 to 270
this.direction = "l"
this.centerX += 3*Math.cos(angle*Math.PI/180)
this.centerY -= 3*Math.sin(angle*Math.PI/180)
this.hoverangle += this.angleinc

this.moveTo(this.centerX,this.centerY-this.amplitude*Math.sin(this.hoverangle*Ma
th.PI/180))
setTimeout(this.obj+'.fly()',20)
else {
this.flyactive = false
this.slideTo(this
Read the entire article....