home *** CD-ROM | disk | FTP | other *** search
- on findDistance pointA, pointB
- hDistance = pointA[1] - pointB[1]
- vDistance = pointA[2] - pointB[2]
- finalDistance = sqrt((hDistance * hDistance) + (vDistance * vDistance))
- return finalDistance
- end
-
- on findAngle pointA, pointB
- global watchThisAngle
- xDist = pointB[1] - pointA[1]
- yDist = pointB[2] - pointA[2]
- if xDist <> 0 then
- watchThisAngle = atan(1.0 * yDist / xDist) * 180 / PI
- theAngle = atan(1.0 * yDist / xDist) * 180 / PI
- if xDist > 0 then
- theAngle = theAngle + 90
- else
- if xDist < 0 then
- theAngle = theAngle - 90
- else
- if yDist < 0 then
- theAngle = 0
- else
- if yDist > 0 then
- theAngle = 180
- end if
- end if
- end if
- end if
- else
- if yDist < 0 then
- theAngle = 0
- else
- if yDist > 0 then
- theAngle = 180
- end if
- end if
- end if
- return theAngle
- end
-