|
RcdMathLib_doc
Open Source Library for Linear and Non-linear Algebra
|
Go to the documentation of this file.
41 if ((value_arr != NULL) && (approx_value_arr != NULL)
42 && (absolute_error_arr != NULL)) {
43 for (i = 0; i < length; i++) {
44 absolute_error_arr[i] = fabs(
45 value_arr[i] - approx_value_arr[i]);
72 for (i = 0; i < 3; i++) {
73 r_square += pow(target_point[i] - ref_point[i], 2);
76 printf(
"r_sq = %f\n", r_square);
101 for (i = 0; i < m; i++) {
102 for (j = 0; i < 3; j++) {
106 - ref_point_matrix[i][j],
116 - ref_point_matrix[i][2],
127 matrix_t distance_arr[], uint8_t length,
132 for (i = 0; i < length; i++) {
133 if (magnetic_field_strength_arr[i] == 0) {
137 if (angular_theta_arr[i] == 0) {
141 / magnetic_field_strength_arr[i],
155 angular_theta_arr[i]),
157 / magnetic_field_strength_arr[i],
179 r = pow(k * sqrt(1 + 3 * pow(sin(theta), 2)) / B,
189 matrix_t anchor_pos_matrix[anchor_num][3],
190 matrix_t pseudo_inv_matrix[4][anchor_num],
199 homog_sol_arr, dist_arr, solution_x1, solution_x2);
vector_t vector_get_norm2(uint8_t length, vector_t arr[])
Compute the 2-norm norm of a vector.
void vector_flex_print(uint32_t length, vector_t arr[], uint8_t before_dot, uint8_t after_dot)
Display the values of the vector's elements.
#define MILPS_MAX_DIST
The number of turns of the wire.
Implement the trilateration algorithm.
matrix_t magnetic_based_get_r(matrix_t B, matrix_t theta, matrix_t k)
Computes the distance between a mobile station and a reference stations of a magnet-based localizatio...
Functions of of DC-pulsed, magnetic localization system.
void magnetic_based_get_distances(matrix_t magnetic_field_strength_arr[], matrix_t angular_theta_arr[], matrix_t distance_arr[], uint8_t length, matrix_t k)
Computes the distances between a mobile station and the reference stations of a magnet-based localiza...
void magnetic_based_get_magnetic_field_vec(uint8_t m, matrix_t ref_point_matrix[m][3], matrix_t target_point[], matrix_t k, matrix_t magn_field_vec[])
Computes the magnetic field strengths from a mobile station to various reference stations.
void magnetic_based_preprocessing_get_position(uint8_t anchor_num, matrix_t anchor_pos_matrix[anchor_num][3], matrix_t pseudo_inv_matrix[4][anchor_num], matrix_t homog_sol_arr[], matrix_t solution_x1[], matrix_t solution_x2[])
Computes the position of a mobile station by a magnetic-based localization system.
#define matrix_t
Define the data type of the matrix elements.
void trilateration1(uint8_t anchor_num, matrix_t anchor_pos_matrix[anchor_num][3], matrix_t pseudo_inv_matrix[4][anchor_num], matrix_t homog_sol_arr[], matrix_t dist_arr[], matrix_t solution_x1[], matrix_t solution_x2[])
Implement the trilateration algorithm using the pre-processed pseudo-inverse matrix.
matrix_t magnetic_based_get_distances_to_anchors(matrix_t ref_point[3], matrix_t point[3])
Computes the distance between a mobile station and a reference station of magnetic-based localization...
void vector_sub(uint8_t size, vector_t a_vec[], vector_t b_vec[], vector_t a_minus_b[])
Compute the subtraction of two vectors.
void magnetic_based_get_absolute_error(matrix_t value_arr[], matrix_t approx_value_arr[], matrix_t absolute_error_arr[], uint8_t length)
Computes the absolute error of a position of magnet-based localization system.
matrix_t magnetic_based_get_magnetic_field(matrix_t ref_point[3], matrix_t target_point[3], matrix_t k)
Computes the magnetic field strength from a mobile station to a reference station.