> 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/game/math.md).

# Точки и углы

Типы Point и Angles для позиций и направления взгляда.

Позиции и направление взгляда API возвращает в виде двух простых типов. Оба неизменяемые и имеют публичные конструкторы, поэтому свои точки и углы можно создавать без ограничений.

## Point

Точка в мире.

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

Здесь создаётся точка на уровне глаз и измеряется расстояние от неё до цели.

| Метод               | Тип      | Описание                   |
| ------------------- | -------- | -------------------------- |
| `x()`, `y()`, `z()` | `double` | координаты                 |
| `distance(other)`   | `double` | расстояние до другой точки |

Точки возвращают `player().position()`, `entity.position()`, `block.center()`, `motion()` у игрока и сущностей, `attackPoint`, `Motion.position()` и `Trajectory.points()`.

## Angles

Два угла взгляда в градусах: поворот по горизонтали (yaw) и наклон по вертикали (pitch).

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

| Метод     | Тип     | Описание                             |
| --------- | ------- | ------------------------------------ |
| `yaw()`   | `float` | по горизонтали, как в игре           |
| `pitch()` | `float` | по вертикали: `-90` вверх, `90` вниз |

Углы возвращают `rotations().player()`, `rotations().sent()` и `rotations().lookAt(...)`.

## Векторы

Для полноценной векторной математики скрипту доступна библиотека `org.joml`: `Vector3d`, `Vector3f`, `Matrix4f` и остальные классы. `Point` не преобразуется в `Vector3d` автоматически, это делается вручную: `new Vector3d(p.x(), p.y(), p.z())`.

Сканирование блоков в кубе возвращает не точки, а плоские массивы, об этом рассказано на странице [Мир и блоки](/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/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.
