# Give a point three coordinates

Read X, Y, and Z without needing a giant maths lesson.

Last updated: 2026-09-09

Package: dolphin.spatial3d | Status: complete-program

Tags: cpu, dolphin.math, dolphin.spatial3d, recipe

A location on paper needs two numbers. A location in a room needs three. Vector3 stores X, Y, and Z together. In Crystal Garden, X and Z describe the ground and Y describes height. The origin is (0, 0, 0), a chosen reference point. Negative coordinates are useful: a crystal can sit to either side of the center. You choose what a world unit means in your game.

```yh
start.yh
```


## Give a point three coordinates

Read X, Y, and Z without needing a giant maths lesson.

Verification: type checked

```yh
using dolphin.math
using dolphin.spatial3d

Vector3 start = Vector3(0.0, 0.0, 0.0)
Vector3 target = Vector3(3.0, 4.0, 0.0)
Console.Log(Text.From(DolphinDistance3(start, target)))
```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.recipe__space"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "dolphin.math"
version = "0.1.0"
path = "../../../dolphin/packages/math"

[[dependencies]]
package = "dolphin.spatial3d"
version = "0.1.0"
path = "../../../dolphin/packages/spatial3d"

```

Expected output:

```text
5
```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/recipe--space/program --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


Change the target to (0, 0, 5). Then compare the result with the original target.

Source: demonhunterlabs/app/lib/yeho-walkthrough.ts

AI training permission: https://demonhunterlabs.com/ai-use
