# NearFarScalar

#### new Cesium.NearFarScalar(near, nearValue, far, farValue)
engine/Source/Core/NearFarScalar.js 16

Represents a scalar value's lower and upper bound at a near distance and far distance in eye space.

Name | Type | Default | Description
--- | --- | --- | ---
`near` | number | `0.0` | optional The lower bound of the camera range.
`nearValue` | number | `0.0` | optional The value at the lower bound of the camera range.
`far` | number | `1.0` | optional The upper bound of the camera range.
`farValue` | number | `0.0` | optional The value at the upper bound of the camera range.

##### See:

- Packable

### Members

#### static Cesium.NearFarScalar.packedLength : number
engine/Source/Core/NearFarScalar.js 75

The number of elements used to pack the object into an array.

#### far : number
engine/Source/Core/NearFarScalar.js 34

The upper bound of the camera range.

Default Value: `1.0`

#### farValue : number
engine/Source/Core/NearFarScalar.js 40

The value at the upper bound of the camera range.

Default Value: `0.0`

#### near : number
engine/Source/Core/NearFarScalar.js 22

The lower bound of the camera range.

Default Value: `0.0`

#### nearValue : number
engine/Source/Core/NearFarScalar.js 28

The value at the lower bound of the camera range.

Default Value: `0.0`

### Methods

#### static Cesium.NearFarScalar.clone(nearFarScalar, result) → NearFarScalar
engine/Source/Core/NearFarScalar.js 50

Duplicates a NearFarScalar instance.

Name | Type | Description
--- | --- | ---
`nearFarScalar` | NearFarScalar | The NearFarScalar to duplicate.
`result` | NearFarScalar | optional The object onto which to store the result.

##### Returns:

The modified result parameter or a new NearFarScalar instance if one was not provided. (Returns undefined if nearFarScalar is undefined)

#### static Cesium.NearFarScalar.equals(left, right) → boolean
engine/Source/Core/NearFarScalar.js 141

Compares the provided NearFarScalar and returns `true` if they are equal, `false` otherwise.

Name | Type | Description
--- | --- | ---
`left` | NearFarScalar | optional The first NearFarScalar.
`right` | NearFarScalar | optional The second NearFarScalar.

##### Returns:

`true` if left and right are equal; otherwise `false`.

#### static Cesium.NearFarScalar.pack(value, array, startingIndex) → Array.<number>
engine/Source/Core/NearFarScalar.js 86

Stores the provided instance into the provided array.

Name | Type | Default | Description
--- | --- | --- | ---
`value` | NearFarScalar |  | The value to pack.
`array` | Array.<number> |  | The array to pack into.
`startingIndex` | number | `0` | optional The index into the array at which to start packing the elements.

##### Returns:

The array that was packed into

#### static Cesium.NearFarScalar.unpack(array, startingIndex, result) → NearFarScalar
engine/Source/Core/NearFarScalar.js 114

Retrieves an instance from a packed array.

Name | Type | Default | Description
--- | --- | --- | ---
`array` | Array.<number> |  | The packed array.
`startingIndex` | number | `0` | optional The starting index of the element to be unpacked.
`result` | NearFarScalar |  | optional The object into which to store the result.

##### Returns:

The modified result parameter or a new NearFarScalar instance if one was not provided.

#### clone(result) → NearFarScalar
engine/Source/Core/NearFarScalar.js 159

Duplicates this instance.

Name | Type | Description
--- | --- | ---
`result` | NearFarScalar | optional The object onto which to store the result.

##### Returns:

The modified result parameter or a new NearFarScalar instance if one was not provided.

#### equals(right) → boolean
engine/Source/Core/NearFarScalar.js 170

Compares this instance to the provided NearFarScalar and returns `true` if they are equal, `false` otherwise.

Name | Type | Description
--- | --- | ---
`right` | NearFarScalar | optional The right hand side NearFarScalar.

##### Returns:

`true` if left and right are equal; otherwise `false`.

Need help? The fastest way to get answers is from the community and team on the Cesium Forum.