---
title: "Common | Customer's Canvas On-Premises"
canonical: "https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/Common/"
---

# Common

> use `clamp` from @aurigma/utils-js/math

## Variables

### ~~Clamp~~

```ts
const Clamp: any = clamp;
```

#### Deprecated

***

### ~~EqualsOfFloatNumbers~~

```ts
const EqualsOfFloatNumbers: any = equalsFloatNumbers;
```

#### Deprecated

use `equalsFloatNumbers` from @aurigma/utils-js/math

## Functions

### ConvertDegreeToRadian()

```ts
function ConvertDegreeToRadian(angle): number;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `angle` | `number` |

#### Returns

`number`

***

### ConvertRadianToDegree()

```ts
function ConvertRadianToDegree(angle): number;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `angle` | `number` |

#### Returns

`number`

***

### getBounds()

```ts
function getBounds(points): RectangleF;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `points` | [`PointF`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/PointF.md#pointf)[] |

#### Returns

[`RectangleF`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/RectangleF.md#rectanglef)

***

### getLineWidth()

```ts
function getLineWidth(
   p1, 
   p2, 
   width, 
   scaleX, 
   scaleY): number;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `p1` | [`PointF`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/PointF.md#pointf) |
| `p2` | [`PointF`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/PointF.md#pointf) |
| `width` | `number` |
| `scaleX` | `number` |
| `scaleY` | `number` |

#### Returns

`number`

***

### getOrientedSquare()

```ts
function getOrientedSquare(
   p1, 
   p2, 
   p3): number;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `p1` | [`PointF`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/PointF.md#pointf) |
| `p2` | [`PointF`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/PointF.md#pointf) |
| `p3` | [`PointF`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/PointF.md#pointf) |

#### Returns

`number`

***

### getScalarProduct()

```ts
function getScalarProduct(v1, v2): number;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `v1` | [`PointF`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/PointF.md#pointf) |
| `v2` | [`PointF`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/PointF.md#pointf) |

#### Returns

`number`

***

### getSquareDistanceToPoint()

```ts
function getSquareDistanceToPoint(p1, p2): number;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `p1` | [`PointF`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/PointF.md#pointf) |
| `p2` | [`PointF`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/PointF.md#pointf) |

#### Returns

`number`

***

### getSquareDistanceToSegment()

```ts
function getSquareDistanceToSegment(
   p, 
   p1, 
   p2): number;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `p` | [`PointF`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/PointF.md#pointf) |
| `p1` | [`PointF`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/PointF.md#pointf) |
| `p2` | [`PointF`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/PointF.md#pointf) |

#### Returns

`number`

***

### getTriangleAngle()

```ts
function getTriangleAngle(
   p1, 
   p2, 
   p3): number;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `p1` | [`PointF`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/PointF.md#pointf) |
| `p2` | [`PointF`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/PointF.md#pointf) |
| `p3` | [`PointF`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/PointF.md#pointf) |

#### Returns

`number`
