---
title: "Class Utils | Customer's Canvas On-Premises"
canonical: "https://customerscanvas.com/docs/on-premises/design-atoms-cs/reference/api/Aurigma.DesignAtoms.Model.Math/Utils/"
---

# Class Utils

> **Inheritance:** `System.Object` -> Utils

###### **Namespace**: [Aurigma.DesignAtoms.Model.Math](https://customerscanvas.com/docs/on-premises/design-atoms-cs/reference/api/Aurigma.DesignAtoms.Model.Math.md)

###### **Assembly**: Aurigma.DesignAtoms.Model.dll

```csharp title="Syntax"
public class Utils
```

## Inherited Members

* `System.Object.ToString`
* `System.Object.Equals(System.Object)`
* `System.Object.Equals(System.Object,System.Object)`
* `System.Object.ReferenceEquals(System.Object,System.Object)`
* `System.Object.GetHashCode`
* `System.Object.GetType`
* `System.Object.MemberwiseClone`

## Constructors

### Utils

```csharp
public Utils()
```

## Methods

### GetFitSize

```csharp
public static SizeF GetFitSize(double sourceWidth, double sourceHeight, double targetWidth, double targetHeight)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `System.Double` | *sourceWidth* |  |
| `System.Double` | *sourceHeight* |  |
| `System.Double` | *targetWidth* |  |
| `System.Double` | *targetHeight* |  |

##### Returns

`System.Drawing.SizeF`

### ConvertDegreeToRadian

```csharp
public static double ConvertDegreeToRadian(double angle)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `System.Double` | *angle* |  |

##### Returns

`System.Double`

### ConvertRadianToDegree

```csharp
public static double ConvertRadianToDegree(double angle)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `System.Double` | *angle* |  |

##### Returns

`System.Double`

### EqualsOfRectangleF

```csharp
public static bool EqualsOfRectangleF(RectangleF rect1, RectangleF rect2, double tolerance = 0.0001)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `System.Drawing.RectangleF` | *rect1* |  |
| `System.Drawing.RectangleF` | *rect2* |  |
| `System.Double` | *tolerance* |  |

##### Returns

`System.Boolean`

### EqualsOfFloatNumbers

```csharp
public static bool EqualsOfFloatNumbers(double f1, double f2, double tolerance = 0.0001)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `System.Double` | *f1* |  |
| `System.Double` | *f2* |  |
| `System.Double` | *tolerance* |  |

##### Returns

`System.Boolean`

### EqualsOfNullableFloats

```csharp
public static bool EqualsOfNullableFloats(float? f1, float? f2, double tolerance = 0.0001)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `System.Nullable<System.Single>` | *f1* |  |
| `System.Nullable<System.Single>` | *f2* |  |
| `System.Double` | *tolerance* |  |

##### Returns

`System.Boolean`

### EqualsOfPointF

```csharp
public static bool EqualsOfPointF(PointF point1, PointF point2, double tolerance = 0.0001)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| [Aurigma.DesignAtoms.Model.Math.PointF](https://customerscanvas.com/docs/on-premises/design-atoms-cs/reference/api/Aurigma.DesignAtoms.Model.Math/PointF.md) | *point1* |  |
| [Aurigma.DesignAtoms.Model.Math.PointF](https://customerscanvas.com/docs/on-premises/design-atoms-cs/reference/api/Aurigma.DesignAtoms.Model.Math/PointF.md) | *point2* |  |
| `System.Double` | *tolerance* |  |

##### Returns

`System.Boolean`

### EqualsOfPointF

```csharp
public static bool EqualsOfPointF(PointF point1, PointF point2, double tolerance = 0.0001)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `System.Drawing.PointF` | *point1* |  |
| `System.Drawing.PointF` | *point2* |  |
| `System.Double` | *tolerance* |  |

##### Returns

`System.Boolean`

### ConvertPointsToPixels

```csharp
public static Path ConvertPointsToPixels(float dpi, Path path)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `System.Single` | *dpi* |  |
| [Aurigma.DesignAtoms.Model.Math.Path](https://customerscanvas.com/docs/on-premises/design-atoms-cs/reference/api/Aurigma.DesignAtoms.Model.Math/Path.md) | *path* |  |

##### Returns

[Aurigma.DesignAtoms.Model.Math.Path](https://customerscanvas.com/docs/on-premises/design-atoms-cs/reference/api/Aurigma.DesignAtoms.Model.Math/Path.md)

### ConvertPointsToPixels

```csharp
public static RotatedRectangleF ConvertPointsToPixels(float dpi, RotatedRectangleF rect)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `System.Single` | *dpi* |  |
| [Aurigma.DesignAtoms.Model.Math.RotatedRectangleF](https://customerscanvas.com/docs/on-premises/design-atoms-cs/reference/api/Aurigma.DesignAtoms.Model.Math/RotatedRectangleF.md) | *rect* |  |

##### Returns

[Aurigma.DesignAtoms.Model.Math.RotatedRectangleF](https://customerscanvas.com/docs/on-premises/design-atoms-cs/reference/api/Aurigma.DesignAtoms.Model.Math/RotatedRectangleF.md)

### ConvertPointsToPixels

```csharp
public static int ConvertPointsToPixels(float dpi, float points)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `System.Single` | *dpi* |  |
| `System.Single` | *points* |  |

##### Returns

`System.Int32`

### ConvertPointsToPixelsFloat

```csharp
public static float ConvertPointsToPixelsFloat(float dpi, float points)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `System.Single` | *dpi* |  |
| `System.Single` | *points* |  |

##### Returns

`System.Single`

### ConvertPointsToPixelsFloat

```csharp
public static PointF ConvertPointsToPixelsFloat(float dpi, PointF point)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `System.Single` | *dpi* |  |
| [Aurigma.DesignAtoms.Model.Math.PointF](https://customerscanvas.com/docs/on-premises/design-atoms-cs/reference/api/Aurigma.DesignAtoms.Model.Math/PointF.md) | *point* |  |

##### Returns

[Aurigma.DesignAtoms.Model.Math.PointF](https://customerscanvas.com/docs/on-premises/design-atoms-cs/reference/api/Aurigma.DesignAtoms.Model.Math/PointF.md)

### ConvertPixelsToPoints

```csharp
public static float ConvertPixelsToPoints(float dpi, int pixels)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `System.Single` | *dpi* |  |
| `System.Int32` | *pixels* |  |

##### Returns

`System.Single`

### ConvertPixelsToPoints

```csharp
public static float ConvertPixelsToPoints(float dpi, float pixels)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `System.Single` | *dpi* |  |
| `System.Single` | *pixels* |  |

##### Returns

`System.Single`

### ConvertPixelsToPoints

```csharp
public static IEnumerable<float> ConvertPixelsToPoints(float dpi, IEnumerable<float> pixels)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `System.Single` | *dpi* |  |
| `System.Collections.Generic.IEnumerable<System.Single>` | *pixels* |  |

##### Returns

`System.Collections.Generic.IEnumerable<System.Single>`

### ConvertPixelsToPoints

```csharp
public static RectangleF ConvertPixelsToPoints(float dpi, RectangleF pixelRect)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `System.Single` | *dpi* |  |
| `System.Drawing.RectangleF` | *pixelRect* |  |

##### Returns

`System.Drawing.RectangleF`

### ConvertPointsToPixels

```csharp
public static RectangleF ConvertPointsToPixels(float dpi, RectangleF pointRect)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `System.Single` | *dpi* |  |
| `System.Drawing.RectangleF` | *pointRect* |  |

##### Returns

`System.Drawing.RectangleF`

### GetCenter

```csharp
public static PointF GetCenter(RectangleF rect)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `System.Drawing.RectangleF` | *rect* |  |

##### Returns

[Aurigma.DesignAtoms.Model.Math.PointF](https://customerscanvas.com/docs/on-premises/design-atoms-cs/reference/api/Aurigma.DesignAtoms.Model.Math/PointF.md)

### ScaleFloat

```csharp
public static float ScaleFloat(float value, float scale, float? minimum, float? maximum)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `System.Single` | *value* |  |
| `System.Single` | *scale* |  |
| `System.Nullable<System.Single>` | *minimum* |  |
| `System.Nullable<System.Single>` | *maximum* |  |

##### Returns

`System.Single`

### RoundFloat

```csharp
public static float RoundFloat(float value, int digits)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `System.Single` | *value* |  |
| `System.Int32` | *digits* |  |

##### Returns

`System.Single`
