> For the complete documentation index, see [llms.txt](https://augustus-pash.gitbook.io/wasm/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://augustus-pash.gitbook.io/wasm/maths-algorithms/distance-function.md).

# Dist

Gets the distance between points.

```javascript
(module
  (func (export "dist") (param $x1 f32) (param $y1 f32) (param $x2 f32) (param $y2 f32) (result f32)
    (local $x0 f32)
    (local $y0 f32)

    (f32.sub (get_local $x1) (get_local $x2))
    set_local $x0
    (f32.sub (get_local $y1) (get_local $y2))
    set_local $y0

    (f32.add
      (f32.mul (get_local $x0) (get_local $x0))
      (f32.mul (get_local $y0) (get_local $y0))
    )

    f32.sqrt
  )
)
```
