{-807.3, 238.5, 1363.4, -1217.3, 167.0, 125.0, 0.0, 5.9, 7.7, -8.5, -0.6, 0.5, 0.0, }
};
-
const float cd[13][13] = {
{0.0, 11.6, -18.1, 1.0, -7.9, -7.9, -2.9, 2.7, -5.0, 0.0, 0.0, 0.0, 0.0, },
{-25.9, 16.5, -7.6, -12.6, 12.7, 6.1, -3.8, -3.5, 6.7, -12.7, 0.0, 0.0, 0.0, },
int getInclination(float *incl)
{
- if (incl == NULL)
- return -1;
+ if (incl == NULL)
+ return -1;
- *incl = g_inclination;
+ *incl = g_inclination;
- return 0;
+ return 0;
}
int setCoordinate(float latitude, float longitude, float altitude, float *declination, float *inclination, int option)
dec = 0;
}
- if (option == 1) {
+ if (option == 1) {
if (declination != NULL)
*declination = dec;
if (inclination != NULL)
{
static int maxord, n, m, j, D1, D2, D3, D4;
static float tc[13][13], dp[13][13], snorm[169],
- sp[13], cp[13], fn[13], fm[13], pp[13], k[13][13], pi, dtr, a, b, re,
- a2, b2, c2, a4, b4, c4, flnmj, otime, oalt,
- olat, olon, dt, rlon, rlat, srlon, srlat, crlon, crlat, srlat2,
- crlat2, q, q1, q2, ct, st, r2, r, d, ca, sa, aor, ar, br, bt, bp, bpp,
- par, temp1, temp2, parp, bx, by, bz, bh;
+ sp[13], cp[13], fn[13], fm[13], pp[13], k[13][13], pi, dtr, a, b, re,
+ a2, b2, c2, a4, b4, c4, flnmj, otime, oalt,
+ olat, olon, dt, rlon, rlat, srlon, srlat, crlon, crlat, srlat2,
+ crlat2, q, q1, q2, ct, st, r2, r, d, ca, sa, aor, ar, br, bt, bp, bpp,
+ par, temp1, temp2, parp, bx, by, bz, bh;
static float *p = snorm;
switch (IENTRY) {case 0: goto GEOMAG; case 1: goto GEOMG1; }
#define SENSOR_LISTENER_MAGIC 0xCAFECAFE
-static int sensor_connect (sensor_h sensor, sensor_listener_h listener)
+static int sensor_connect(sensor_h sensor, sensor_listener_h listener)
{
int id = SENSOR_UNDEFINED_ID;
int event_type;
* FUNCTIONS : SENSOR_UTIL_*
*/
-int sensor_util_get_declination (float latitude, float longitude, float altitude, float *declination)
+int sensor_util_get_declination(float latitude, float longitude, float altitude, float *declination)
{
if (!declination)
return SENSOR_ERROR_INVALID_PARAMETER;
- setCoordinate (latitude, longitude, altitude, declination, NULL, 1);
+ setCoordinate(latitude, longitude, altitude, declination, NULL, 1);
return SENSOR_ERROR_NONE;
}
-int sensor_util_get_angle_change (float R[], float prevR[], float angleChange[])
+int sensor_util_get_angle_change(float R[], float prevR[], float angleChange[])
{
- if (getAngleChange (R, prevR, angleChange) < 0)
+ if (getAngleChange(R, prevR, angleChange) < 0)
return SENSOR_ERROR_INVALID_PARAMETER;
return SENSOR_ERROR_NONE;
}
-int sensor_util_get_orientation (float R[], float values[])
+int sensor_util_get_orientation(float R[], float values[])
{
if (!R || !values)
return SENSOR_ERROR_INVALID_PARAMETER;
- values[0] = (float) atan2 (R[1], R[4]);
- values[1] = (float) asin (-R[7]);
- values[2] = (float) atan2 (-R[6], R[8]);
+ values[0] = (float) atan2(R[1], R[4]);
+ values[1] = (float) asin(-R[7]);
+ values[2] = (float) atan2(-R[6], R[8]);
return SENSOR_ERROR_NONE;
}
-int sensor_util_get_inclination (float I[], float* inclination)
+int sensor_util_get_inclination(float I[], float* inclination)
{
if (!I || !inclination)
return SENSOR_ERROR_INVALID_PARAMETER;
return SENSOR_ERROR_NONE;
}
-int sensor_util_remap_coordinate_system (float inR[], sensor_util_axis_e x, sensor_util_axis_e y, float outR[])
+int sensor_util_remap_coordinate_system(float inR[], sensor_util_axis_e x, sensor_util_axis_e y, float outR[])
{
- if (remapCoordinateSystem (inR, x, y, outR) < 0)
+ if (remapCoordinateSystem(inR, x, y, outR) < 0)
return SENSOR_ERROR_INVALID_PARAMETER;
return SENSOR_ERROR_NONE;
}
-int sensor_util_get_rotation_matrix_from_vector (float Vx, float Vy, float Vz, float R[])
+int sensor_util_get_rotation_matrix_from_vector(float Vx, float Vy, float Vz, float R[])
{
float RV[4] = {0, Vx, Vy, Vz};
- RV[0] = 1 - Vx * Vx - Vy*Vy - Vz*Vz;
- RV[0] = (Vx > 0) ? (float) (sqrt (Vx)) : 0;
+ RV[0] = 1 - Vx * Vx - Vy * Vy - Vz * Vz;
+ RV[0] = (Vx > 0) ? (float) (sqrt(Vx)) : 0;
if (quatToMatrix(RV, R) < 0)
return SENSOR_ERROR_INVALID_PARAMETER;
return SENSOR_ERROR_NONE;
}
-int sensor_util_get_rotation_matrix (float Gx, float Gy, float Gz,float Mx, float My, float Mz,float R[], float I[])
+int sensor_util_get_rotation_matrix(float Gx, float Gy, float Gz,float Mx, float My, float Mz, float R[], float I[])
{
float G[3] = {Gx, Gy, Gz};
float M[3] = {Mx, My, Mz};
- if (getRotationMatrix (G, M, R, I) < 0)
+ if (getRotationMatrix(G, M, R, I) < 0)
return SENSOR_ERROR_INVALID_PARAMETER;
return SENSOR_ERROR_NONE;