---
title: "vec2f"
canonical_url: "https://www.nutrient.io/api/python/types/vec2f/"
md_url: "https://www.nutrient.io/api/python/types/vec2f.md"
last_updated: "2026-07-15T14:46:57.766Z"
description: "Represents a 2D vector with X and Y components as floating-point values. Used to specify positions, sizes, and other 2D measurements in PDF coordinate space."
---

Represents a 2D vector with X and Y components as floating-point values. Used to specify positions, sizes, and other 2D measurements in PDF coordinate space.

```python

from nutrient_sdk.vec2f import vec2f

```

## Construction

```python

vec2f(x: float, y: float)

```

## Fields

| Field | Type    | Description                |
| ----- | ------- | -------------------------- |
| `x`   | `float` | The X component in points. |
| `y`   | `float` | The Y component in points. |

## Usage Example

```python

from nutrient_sdk.vec2f import vec2f

value = vec2f(x=36.0, y=72.0)

```

---

## Related pages

- [All public classes import directly from the top-level package:](/api/python/types.md)
- [Color](/api/python/types/color.md)
- [Rect F](/api/python/types/rect-f.md)

