[API](/solutions/geotoolkit/geotoolkit_js/apis/readme) / [geotoolkit](/solutions/geotoolkit/geotoolkit_js/apis/modules/geotoolkit) / [deviation](/solutions/geotoolkit/geotoolkit_js/apis/modules/geotoolkit.deviation) / [AspectRatioTrackWidthStrategy](/solutions/geotoolkit/geotoolkit_js/apis/modules/geotoolkit.deviation#aspectratiotrackwidthstrategy) / AspectRatioTrackWidthStrategy

# Class: AspectRatioTrackWidthStrategy

[deviation](/solutions/geotoolkit/geotoolkit_js/apis/modules/geotoolkit.deviation).[AspectRatioTrackWidthStrategy](/solutions/geotoolkit/geotoolkit_js/apis/modules/geotoolkit.deviation#aspectratiotrackwidthstrategy).AspectRatioTrackWidthStrategy

The strategy sets track width according to the equation:<br>
"trackWidth[device] = trackLength[device] / aspectratio"

## Hierarchy

- [`TrackWidthStrategy`](/solutions/geotoolkit/geotoolkit_js/apis/classes/geotoolkit.deviation.trackwidthstrategy.trackwidthstrategy)
↳ **`AspectRatioTrackWidthStrategy`**


## Table of contents

Constructors
- [new AspectRatioTrackWidthStrategy(options)](/solutions/geotoolkit/GeoToolkit_JS/apis/classes/geotoolkit.deviation.aspectratiotrackwidthstrategy.aspectratiotrackwidthstrategy.md#new aspectratiotrackwidthstrategy(options))


Methods
| [getClassName](/solutions/geotoolkit/geotoolkit_js/apis/classes/geotoolkit.deviation.aspectratiotrackwidthstrategy.aspectratiotrackwidthstrategy#getclassname) | [getDeviceLength](/solutions/geotoolkit/geotoolkit_js/apis/classes/geotoolkit.deviation.aspectratiotrackwidthstrategy.aspectratiotrackwidthstrategy#getdevicelength) | [getWidth](/solutions/geotoolkit/geotoolkit_js/apis/classes/geotoolkit.deviation.aspectratiotrackwidthstrategy.aspectratiotrackwidthstrategy#getwidth) |
|  --- | --- | --- |
| [getClassName](/solutions/geotoolkit/geotoolkit_js/apis/classes/geotoolkit.deviation.aspectratiotrackwidthstrategy.aspectratiotrackwidthstrategy#getclassname-1) |


## Contents

Constructors
#### new AspectRatioTrackWidthStrategy(options)

• **new AspectRatioTrackWidthStrategy**(`options?`)

#### Parameters

| Name  | Type  |
|  --- | --- |
| `Optional` `options` | [`Options`](/solutions/geotoolkit/geotoolkit_js/apis/modules/geotoolkit.deviation#aspectratiotrackwidthstrategy#options) |


#### Overrides

TrackWidthStrategy.constructor

Methods
#### getClassName

▸ **getClassName**(): `string`

#### Returns

`string`

#### Inherited from

[TrackWidthStrategy](/solutions/geotoolkit/geotoolkit_js/apis/classes/geotoolkit.deviation.trackwidthstrategy.trackwidthstrategy).[getClassName](/solutions/geotoolkit/geotoolkit_js/apis/classes/geotoolkit.deviation.trackwidthstrategy.trackwidthstrategy#getclassname)

#### getDeviceLength

▸ **getDeviceLength**(`trajectory`, `tr`): `Object`

Calculates trajectory widths (both: model and device)

#### Parameters

| Name  | Type  | Description  |
|  --- | --- | --- |
| `trajectory` | [`Trajectory2d`](/solutions/geotoolkit/geotoolkit_js/apis/classes/geotoolkit.deviation.trajectory2d.trajectory2d) | trajectory |
| `tr` | [`Transformation`](/solutions/geotoolkit/geotoolkit_js/apis/classes/geotoolkit.util.transformation.transformation) | transformation to device |


#### Returns

`Object`

| Name | Type |
|  --- | --- |
| `devicelength` | `number` |
| `length` | `number` |


#### Inherited from

[TrackWidthStrategy](/solutions/geotoolkit/geotoolkit_js/apis/classes/geotoolkit.deviation.trackwidthstrategy.trackwidthstrategy).[getDeviceLength](/solutions/geotoolkit/geotoolkit_js/apis/classes/geotoolkit.deviation.trackwidthstrategy.trackwidthstrategy#getdevicelength)

#### getWidth

▸ **getWidth**(`tr`, `options`): `number`

Return track width in pixels

#### Parameters

| Name  | Type  | Description  |
|  --- | --- | --- |
| `tr` | [`Transformation`](/solutions/geotoolkit/geotoolkit_js/apis/classes/geotoolkit.util.transformation.transformation) | transformation to device |
| `options` | `Object` | options |
| `options.trajectory` | [`Trajectory2d`](/solutions/geotoolkit/geotoolkit_js/apis/classes/geotoolkit.deviation.trajectory2d.trajectory2d) | - 
 |
| `options.width` | `number` | - 
 |


#### Returns

`number`

#### Overrides

[TrackWidthStrategy](/solutions/geotoolkit/geotoolkit_js/apis/classes/geotoolkit.deviation.trackwidthstrategy.trackwidthstrategy).[getWidth](/solutions/geotoolkit/geotoolkit_js/apis/classes/geotoolkit.deviation.trackwidthstrategy.trackwidthstrategy#getwidth)

#### getClassName

▸ `Static` **getClassName**(): `string`

#### Returns

`string`

#### Inherited from

[TrackWidthStrategy](/solutions/geotoolkit/geotoolkit_js/apis/classes/geotoolkit.deviation.trackwidthstrategy.trackwidthstrategy).[getClassName](/solutions/geotoolkit/geotoolkit_js/apis/classes/geotoolkit.deviation.trackwidthstrategy.trackwidthstrategy#getclassname-1)