---
title: "Vec2f"
canonical_url: "https://www.nutrient.io/api/csharp/types/vec2f/"
md_url: "https://www.nutrient.io/api/csharp/types/vec2f.md"
last_updated: "2026-10-08T08:55:57.713Z"
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.

```csharp

using Nutrient;

public record struct Vec2f(float X, float Y);

```

## Fields

| Name | Type    | Description                |
| ---- | ------- | -------------------------- |
| `X`  | `float` | The X component in points. |
| `Y`  | `float` | The Y component in points. |

---

## Related pages

- [Types](/api/csharp/types.md)
- [Color](/api/csharp/types/color.md)
- [Rect F](/api/csharp/types/rect-f.md)

