> For the complete documentation index, see [llms.txt](https://daikirai.gitbook.io/scripting/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://daikirai.gitbook.io/scripting/documentation/vec3.md).

# vec3

## Vec3

`Vec3` represents a 3d vector with x, y, and z coordinates for position calculations.

| property | type     | description  |
| -------- | -------- | ------------ |
| x        | `double` | x coordinate |
| y        | `double` | y coordinate |
| z        | `double` | z coordinate |

### ceil

returns a new vector with coordinates rounded up.

```java
Vec3 ceiled = position.ceil();
```

***

### equals

compares two vectors for equality.

```java
boolean equal = position.equals(Vec3 other);
```

***

### floor

returns a new vector with coordinates rounded down.

```java
Vec3 floored = position.floor();
```

***

### inverse

returns a new vector with negated coordinates.

```java
Vec3 inverse = position.inverse();
```

***

### offset

returns a new vector offset by another vector.

```java
Vec3 offset = position.offset(Vec3 amount);
```

***

### offset

returns a new vector offset by values.

```java
Vec3 offset = position.offset(double x, double y, double z);
```

***

### translate

returns current vector translated by another vector.

```java
Vec3 translated = position.translate(Vec3 amount);
```

***

### translate

returns current vector translated by values.

```java
Vec3 translated = position.translate(double x, double y, double z);
```

***

### distanceTo

returns the distance to another vector.

```java
double distance = position.distanceTo(Vec3 other);
```

***

### distanceToSq

returns the squared distance to another vector.

```java
double distanceSq = position.distanceToSq(Vec3 other);
```
