public final class XYEncodingUtils extends Object
Modifier and Type | Field and Description |
---|---|
static double |
MAX_VAL_INCL |
static double |
MIN_VAL_INCL |
Modifier and Type | Method and Description |
---|---|
static float |
decode(byte[] src,
int offset)
Turns quantized value from byte array back into a double.
|
static float |
decode(int encoded)
Turns quantized value from
encode(float) back into a double. |
static int |
encode(float x)
Quantizes double (64 bit) values into 32 bits
|
public static final double MIN_VAL_INCL
public static final double MAX_VAL_INCL
public static int encode(float x)
x
- cartesian valueint
IllegalArgumentException
- if value is out of boundspublic static float decode(int encoded)
encode(float)
back into a double.encoded
- encoded value: 32-bit quantized value.public static float decode(byte[] src, int offset)
src
- byte array containing 4 bytes to decode at offset
offset
- offset into src
to decode from.Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.