High-level Nim wrapper for Pebble Math utilities.
Provides mathematical functions and constants for Pebble development.
Consts
TRIG_MAX_ANGLE = 0x00010000
- Source Edit
TRIG_MAX_RATIO = 65535
- Source Edit
Procs
proc cosLookup(angle: int32): int32 {.inline, ...raises: [], tags: [], forbids: [].}
- Compute the cosine of an angle in Pebble angle units. Returns a value in the range -TRIG_MAX_RATIO, TRIG_MAX_RATIO. Equivalent to C function cos_lookup(angle). Source Edit
proc degToTrigAngle(degrees: float32): int32 {.inline, ...raises: [], tags: [], forbids: [].}
- Convert degrees to Pebble angle units. Equivalent to: degrees * TRIG_MAX_ANGLE / 360.0. Source Edit
proc sinLookup(angle: int32): int32 {.inline, ...raises: [], tags: [], forbids: [].}
- Compute the sine of an angle in Pebble angle units. Returns a value in the range -TRIG_MAX_RATIO, TRIG_MAX_RATIO. Equivalent to C function sin_lookup(angle). Source Edit
proc trigAngleToDeg(angle: int32): float32 {.inline, ...raises: [], tags: [], forbids: [].}
- Convert Pebble angle units to degrees. Equivalent to: angle * 360.0 / TRIG_MAX_ANGLE. Source Edit