# Geometry primitives

Since JavaScript does not ship geometry helpers by default, we at Nutrient developed a set of tested geometry classes that we use throughout all our classes. These types are based on the [Immutable.js](https://immutable-js.com/) library in order to work with immutable data.

This article should give you a quick overview of the basic data types we expose right now and when you want to use them. Refer to the [`NutrientViewer.Geometry` documentation](https://www.nutrient.io/api/web/NutrientViewer.Geometry.html) for an in-depth look at the APIs.

| Nutrient&nbsp;class | Use case                                                                                                                   |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| [`Point`](https://www.nutrient.io/api/web/NutrientViewer.Geometry.Point.html)         | Describe a point in 2D space.                                                                                              |
| [`DrawingPoint`](https://www.nutrient.io/api/web/NutrientViewer.Geometry.DrawingPoint.html)  | An extension of the point with an intensity value. This is used for storing pressure while drawing an [`InkAnnotation`](https://www.nutrient.io/api/web/NutrientViewer.Annotations.InkAnnotation.html). |
| [`Rect`](https://www.nutrient.io/api/web/NutrientViewer.Geometry.Rect.html)          | Describes a rectangle in space. This is the combination of a location (point) and a dimension (size).                      |
| [`Size`](https://www.nutrient.io/api/web/NutrientViewer.Geometry.Size.html)          | Describes the size of an element. This is similar to point, but its value should be interpreted as a dimension.            |

All of these classes come with a number of geometric helpers. For a full list,  refer to the [`NutrientViewer.Geometry` documentation](https://www.nutrient.io/api/web/NutrientViewer.Geometry.html):

### ES6+

```js

const { Point } = NutrientViewer.Geometry;

const point = new Point({ x: 10, y: 20 }).translateX(20).translateY(40).scale(1.5);

console.log(point); // => Point({ x: 45, y: 90 })

```

### JAVASCRIPT

```js

var point = new NutrientViewer.Geometry.Point({ x: 10, y: 20 }).translateX(20).translateY(40).scale(1.5);

console.log(point); // => Point({ x: 45, y: 90 })

```
---

## Related pages

- [Supported annotation types](/guides/web/annotations/introduction-to-annotations.md)
- [Display embedded audio and video files in PDFs using JavaScript](/guides/web/annotations/introduction-to-annotations/media-annotations.md)
- [Working with annotations](/guides/web/annotations/introduction-to-annotations/working-with-annotations.md)
- [Comparing XFDF and Instant JSON for annotations](/guides/web/annotations/introduction-to-annotations/data-formats.md)
- [What are PDF annotations?](/guides/web/annotations/introduction-to-annotations/what-are-annotations.md)

