Aa

Text size

?

Map / Using Objects / 10

⌨️ Write

Distance between points

Write distance so it returns the straight-line distance between (x1, y1) and (x2, y2): the square root of dx² + dy².

  • Math.sqrt()
  • Math.pow()