• My Pages
  • Comments
  • Add Link
  • Subscribe
  • Subscribe User
  • Edit (GUI)
  • Edit (Text)
  • Rename Page
  • Copy Page
  • Load Page
  • Save Page
  • Delete Page
  • Attachments
  • Check Spelling
  • Diffs
  • Info
  • Revert to this revision
  • XML
  • Render as Docbook
  • Print View
  • Raw Text
  • Delete Cache
  • Like Pages
  • Local Site Map
  • Remove Spam
  • Package Pages
  • Sync Pages

    The MapDistance function returns the distance between a set of coordinates.

    Usage:

    MapDistance(x1,y1,x2,y2)

    Example:

    targetX=123
    
    targetY=456
    
    distance=round(MapDistance(city.x,city.y,targetX,targetY),2)
    echo "distance to "+targetX+","+targetY+"="+distance

    returns the distance from your current city coords to 123,456 (rounded to 2 decimal places)

    Related Functions:

    FormatDistance


    CategoryFunctions

    MapDistance (last edited 2013-11-04 20:24:33 by tech)