/* Calculate direction, inclination, and field strength. 
This routine calculates horizontal direction, vertical inclination and net field magnitude for a "raw" (unscaled) magnetic  */
bool field_direction(vector3_t *field, scalar_t *theta, scalar_t *delta, scalar_t *strength)
/* Calculate direction, inclination, and field strength. 
This routine calculates horizontal direction, vertical inclination and net field magnitude for a "raw" (unscaled) magnetic  */
bool field_direction(vector3_t *field, scalar_t *theta, scalar_t *delta, scalar_t *strength)
{
	scalar_t const magnitude = vector3_magnitude(field);
	if (0 == magnitude) {
		return false;
	}
	vector3_scale((1 / magnitude), field);
	*strength = magnitude;
	*theta = degrees(-1 * atan2(field->x, field->y));
	if (*theta < 0) {
		*theta += 360;
	}
	*delta = degrees(-1 * asin(field->z));
	return true;
}