API / geotoolkit / seismic / analysis / util / StepPrecisionUtil / StepPrecisionUtil
util.StepPrecisionUtil.StepPrecisionUtil
This class is used to keep the precision of numbers when steps are used to calculate these numbers.
Constructors
Methods
Methods
▸ getClassName(): string
string
▸ Static convertFloatStepToDouble(step): number
This is needed because a float such as 0.002 gets transformed to 0.00200000123 when doing a single (double) cast.
| Name | Type | Description |
|---|---|---|
step | number | The step amount. |
number
result The converted number.
▸ Static getClassName(): string
string
▸ Static getMinimumFractionDigits(step): number
Gets the Minimum fraction digits
| Name | Type | Description |
|---|---|---|
step | number | The step amount. |
number
result The minimum digits.
▸ Static getNormalizedLineValue(minValue, stepIndex, step): number
Fixes precision calculator of inline and xline numbers. Can be used for time/depth as well result is always >= min never pass floats, always pass doubles works with negative of positive steps
| Name | Type | Description |
|---|---|---|
minValue | number | The minimum value. |
stepIndex | number | The step index. |
step | number | The step amount. |
number
normalizedValue The normalized line value.
▸ Static getNormalizedStepCount(minValue, value, step): number
Fixed precision calculator of step count. same as getNormalizedStepIndex, with 1 added result is always >= 1 never pass floats, always pass doubles don't use arbitrary step values
| Name | Type | Description |
|---|---|---|
minValue | number | The minimum value. |
value | number | The actual value. |
step | number | The step amount. |
number
index The normalized step index.
▸ Static getNormalizedStepIndex(minValue, value, step): number
Fixed precision calculator of step count. same as getNormalizedStepIndex, with 1 added result is always >= 1 never pass floats, always pass doubles don't use arbitrary step values
Throws
Error if value < minValue
| Name | Type | Description |
|---|---|---|
minValue | number | The minimum value. |
value | number | The actual value. |
step | number | The step amount. |
number
index The normalized step index.
▸ Static getNormalizedStepMultiplier(step): number
Finds the number of digits after the dot never pass floats, always pass doubles
Throws
Error if step is too big
| Name | Type | Description |
|---|---|---|
step | number | The step value |
number
multiplier The number of digits
▸ Static getRelativeLineValue(referenceValue, stepIndex, step): number
fixes precision calculator of inline and xline numbers. Can be used for time/depth as well example: StepPrecisionUtil.getNormalizedLineValue(1, 50, 0.1) => 6 example: StepPrecisionUtil.getNormalizedLineValue(1, -50, -0.1) => 6 To use when the reference value is not the minimum value never pass floats, always pass doubles you might want to pass Math(step) as step
| Name | Type | Description |
|---|---|---|
referenceValue | number | The reference value. |
stepIndex | number | The step index. |
step | number | The step amount. |
number
relativeValue The calculated relative value.
▸ Static getRelativeStepIndex(referenceValue, value, step): number
Fixed precision calculator of step indexes. add one to get a step count example: getNormalizedStepIndex(1, 1, 0.1) => 0 example: getNormalizedStepIndex(1, 6, 0.1) => 50 example: getNormalizedStepIndex(1, 6, -0.1) => -50 To use when the reference value is not the minimum value never pass floats, always pass doubles you might want to pass Math(step) as step don't use arbitrary step values
| Name | Type | Description |
|---|---|---|
referenceValue | number | The reference value. |
value | number | The actual value. |
step | number | The step amount. |
number
index The relative index.