> For the complete documentation index, see [llms.txt](https://docs.quickclient.cc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.quickclient.cc/en/game/math.md).

# Points and angles

The Point and Angles types for positions and view direction.

The API returns positions and view direction as two simple types. Both are immutable and have public constructors, so you can create your own points and angles freely.

## Point

A point in the world.

```java
Point eye = new Point(player().x(), player().y() + 1.62, player().z());
double away = eye.distance(target.position());
```

Here a point is created at eye level and the distance from it to the target is measured.

| Method              | Type     | Description               |
| ------------------- | -------- | ------------------------- |
| `x()`, `y()`, `z()` | `double` | coordinates               |
| `distance(other)`   | `double` | distance to another point |

Points are returned by `player().position()`, `entity.position()`, `block.center()`, `motion()` on the player and entities, `attackPoint`, `Motion.position()` and `Trajectory.points()`.

## Angles

Two view angles in degrees: horizontal turn (yaw) and vertical tilt (pitch).

```java
Angles aim = rotations().lookAt(point);
rotations().apply(aim, 180f, 10);
```

| Method    | Type    | Description                   |
| --------- | ------- | ----------------------------- |
| `yaw()`   | `float` | horizontal, as in the game    |
| `pitch()` | `float` | vertical: `-90` up, `90` down |

Angles are returned by `rotations().player()`, `rotations().sent()` and `rotations().lookAt(...)`.

## Vectors

For full vector math, scripts have access to the `org.joml` library: `Vector3d`, `Vector3f`, `Matrix4f` and the other classes. `Point` is not converted to `Vector3d` automatically, you do it by hand: `new Vector3d(p.x(), p.y(), p.z())`.

Scanning blocks in a cube returns flat arrays rather than points, this is covered in [World and blocks](/en/game/world.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.quickclient.cc/en/game/math.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
