From 24dc1013edeaa25c6368e1433cef21b037a81340 Mon Sep 17 00:00:00 2001 From: bailu1992 Date: Thu, 18 Jan 2024 18:36:58 +0800 Subject: [PATCH 1/6] =?UTF-8?q?sensor=203.2-Release=E5=91=8A=E8=AD=A6?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: bailu1992 --- interfaces/native/src/geomagnetic_field.cpp | 12 ++++---- interfaces/native/src/sensor_algorithm.cpp | 29 ++++++++++++------- .../sensoragent_fuzzer/sensoragent_fuzzer.cpp | 3 +- .../hardware/src/hdi_service_impl.cpp | 4 +-- 4 files changed, 28 insertions(+), 20 deletions(-) diff --git a/interfaces/native/src/geomagnetic_field.cpp b/interfaces/native/src/geomagnetic_field.cpp index 31929718..5a76080f 100644 --- a/interfaces/native/src/geomagnetic_field.cpp +++ b/interfaces/native/src/geomagnetic_field.cpp @@ -94,12 +94,12 @@ constexpr float DELTA_GAUSS_COEFFICIENT_H[13][13] = { constexpr int32_t GAUSSIAN_COEFFICIENT_DIMENSION = 13; std::mutex mutex_; -float northComponent; -float eastComponent; -float downComponent; -float geocentricLatitude; -float geocentricLongitude; -float geocentricRadius; +float g_northComponent; +float g_eastComponent; +float g_downComponent; +float g_geocentricLatitude; +float g_geocentricLongitude; +float g_geocentricRadius; std::vector> schmidtQuasiNormalFactors; std::vector> polynomials(GAUSSIAN_COEFFICIENT_DIMENSION); diff --git a/interfaces/native/src/sensor_algorithm.cpp b/interfaces/native/src/sensor_algorithm.cpp index 30fbc963..57ab262e 100644 --- a/interfaces/native/src/sensor_algorithm.cpp +++ b/interfaces/native/src/sensor_algorithm.cpp @@ -73,13 +73,16 @@ int32_t SensorAlgorithm::TransformCoordinateSystemImpl(std::vector inRota int32_t offset = j * matrixDimension; for (int32_t i = 0; i < 3; i++) { if (x == i) { - outRotationMatrix[offset + i] = (axisX >= 0x80) ? -inRotationMatrix[offset + 0] : inRotationMatrix[offset + 0]; + outRotationMatrix[offset + i] = (axisX >= 0x80) ? -inRotationMatrix[offset + 0] : + inRotationMatrix[offset + 0]; } if (y == i) { - outRotationMatrix[offset + i] = (axisY >= 0x80) ? -inRotationMatrix[offset + 1] : inRotationMatrix[offset + 1]; + outRotationMatrix[offset + i] = (axisY >= 0x80) ? -inRotationMatrix[offset + 1] : + inRotationMatrix[offset + 1]; } if (z == i) { - outRotationMatrix[offset + i] = (axisZ >= 0x80) ? -inRotationMatrix[offset + 2] : inRotationMatrix[offset + 2]; + outRotationMatrix[offset + i] = (axisZ >= 0x80) ? -inRotationMatrix[offset + 2] : + inRotationMatrix[offset + 2]; } } } @@ -95,14 +98,16 @@ int32_t SensorAlgorithm::TransformCoordinateSystem(std::vector inRotation std::vector &outRotationMatrix) { int32_t inRotationMatrixLength = static_cast(inRotationMatrix.size()); - if (((inRotationMatrixLength != THREE_DIMENSIONAL_MATRIX_LENGTH) && (inRotationMatrixLength != FOUR_DIMENSIONAL_MATRIX_LENGTH)) - || (inRotationMatrixLength != static_cast(outRotationMatrix.size()))) { + if (((inRotationMatrixLength != THREE_DIMENSIONAL_MATRIX_LENGTH) && + (inRotationMatrixLength != FOUR_DIMENSIONAL_MATRIX_LENGTH)) || + (inRotationMatrixLength != static_cast(outRotationMatrix.size()))) { SEN_HILOGE("Invalid input parameter"); return OHOS::Sensors::PARAMETER_ERROR; } if (inRotationMatrix == outRotationMatrix) { std::vector tempRotationMatrix(inRotationMatrixLength); - if (TransformCoordinateSystemImpl(inRotationMatrix, axisX, axisY, tempRotationMatrix) != OHOS::Sensors::SUCCESS) { + if (TransformCoordinateSystemImpl(inRotationMatrix, axisX, axisY, tempRotationMatrix) != + OHOS::Sensors::SUCCESS) { SEN_HILOGE("TransformCoordinateSystemImpl failed"); return OHOS::Sensors::PARAMETER_ERROR; } @@ -121,7 +126,8 @@ int32_t SensorAlgorithm::GetAltitude(float seaPressure, float currentPressure, f return OHOS::Sensors::PARAMETER_ERROR; } float coef = 1.0f / RECIPROCAL_COEFFICIENT; - float rationOfStandardPressure = currentPressure / seaPressure; + float rationOfStandardPressure = IsEqual(seaPressure, 0.0f) ? + std::numeric_limits::max() : currentPressure / seaPressure; float difference = pow(rationOfStandardPressure, coef); *altitude = ZERO_PRESSURE_ALTITUDE * (1.0f - difference); return OHOS::Sensors::SUCCESS; @@ -317,9 +323,12 @@ int32_t SensorAlgorithm::CreateRotationAndInclination(std::vector gravity rotationMatrix[0] = componentH[0]; rotationMatrix[1] = componentH[1]; rotationMatrix[2] = componentH[2]; - rotationMatrix[3 % ROTATION_VECTOR_LENGTH + (3 / ROTATION_VECTOR_LENGTH) * rotationMatrixDimension] = measuredValue[0]; - rotationMatrix[4 % ROTATION_VECTOR_LENGTH + (4 / ROTATION_VECTOR_LENGTH) * rotationMatrixDimension] = measuredValue[1]; - rotationMatrix[5 % ROTATION_VECTOR_LENGTH + (5 / ROTATION_VECTOR_LENGTH) * rotationMatrixDimension] = measuredValue[2]; + rotationMatrix[3 % ROTATION_VECTOR_LENGTH + (3 / ROTATION_VECTOR_LENGTH) * rotationMatrixDimension] = + measuredValue[0]; + rotationMatrix[4 % ROTATION_VECTOR_LENGTH + (4 / ROTATION_VECTOR_LENGTH) * rotationMatrixDimension] = + measuredValue[1]; + rotationMatrix[5 % ROTATION_VECTOR_LENGTH + (5 / ROTATION_VECTOR_LENGTH) * rotationMatrixDimension] = + measuredValue[2]; rotationMatrix[6 % ROTATION_VECTOR_LENGTH + (6 / ROTATION_VECTOR_LENGTH) * rotationMatrixDimension] = gravity[0]; rotationMatrix[7 % ROTATION_VECTOR_LENGTH + (7 / ROTATION_VECTOR_LENGTH) * rotationMatrixDimension] = gravity[1]; rotationMatrix[8 % ROTATION_VECTOR_LENGTH + (8 / ROTATION_VECTOR_LENGTH) * rotationMatrixDimension] = gravity[2]; diff --git a/interfaces/native/test/fuzztest/sensoragent_fuzzer/sensoragent_fuzzer.cpp b/interfaces/native/test/fuzztest/sensoragent_fuzzer/sensoragent_fuzzer.cpp index d780c28d..b45630a0 100644 --- a/interfaces/native/test/fuzztest/sensoragent_fuzzer/sensoragent_fuzzer.cpp +++ b/interfaces/native/test/fuzztest/sensoragent_fuzzer/sensoragent_fuzzer.cpp @@ -34,8 +34,7 @@ bool CheckSensorTypeId(int32_t sensorTypeId) if (ret != 0) { return false; } - for (int32_t i = 0; i < count; i++) - { + for (int32_t i = 0; i < count; i++) { if ((sensorInfo + i)->sensorTypeId == sensorTypeId) { return true; } diff --git a/services/sensor/hdi_connection/hardware/src/hdi_service_impl.cpp b/services/sensor/hdi_connection/hardware/src/hdi_service_impl.cpp index 6a67a16c..19dac19c 100644 --- a/services/sensor/hdi_connection/hardware/src/hdi_service_impl.cpp +++ b/services/sensor/hdi_connection/hardware/src/hdi_service_impl.cpp @@ -31,10 +31,10 @@ std::vector g_sensorInfos = { {"sensor_test", "default", "1.0.0", "1.0.0", 0, 0, 9999.0, 0.000001, 23.0, 100000000, 1000000000}, }; std::vector supportSensors = {0}; -float testData[] = {9.8}; +float g_testData[] = {9.8F}; SensorEvents testEvent = { .sensorId = 0, - .data = (uint8_t *)testData, + .data = static_cast(g_testData), .dataLen = 4 }; } -- Gitee From c3f41194df824a4cab1c4a0ff7d503b43ae0887c Mon Sep 17 00:00:00 2001 From: bailu1992 Date: Fri, 19 Jan 2024 09:59:10 +0800 Subject: [PATCH 2/6] sensor 3.2-Release Branch alarm Modified Signed-off-by: bailu1992 --- interfaces/native/src/sensor_algorithm.cpp | 4 ++-- .../sensor/hdi_connection/hardware/src/hdi_service_impl.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/interfaces/native/src/sensor_algorithm.cpp b/interfaces/native/src/sensor_algorithm.cpp index 57ab262e..2e4eb78c 100644 --- a/interfaces/native/src/sensor_algorithm.cpp +++ b/interfaces/native/src/sensor_algorithm.cpp @@ -325,9 +325,9 @@ int32_t SensorAlgorithm::CreateRotationAndInclination(std::vector gravity rotationMatrix[2] = componentH[2]; rotationMatrix[3 % ROTATION_VECTOR_LENGTH + (3 / ROTATION_VECTOR_LENGTH) * rotationMatrixDimension] = measuredValue[0]; - rotationMatrix[4 % ROTATION_VECTOR_LENGTH + (4 / ROTATION_VECTOR_LENGTH) * rotationMatrixDimension] = + rotationMatrix[4 % ROTATION_VECTOR_LENGTH + (4 / ROTATION_VECTOR_LENGTH) * rotationMatrixDimension] = measuredValue[1]; - rotationMatrix[5 % ROTATION_VECTOR_LENGTH + (5 / ROTATION_VECTOR_LENGTH) * rotationMatrixDimension] = + rotationMatrix[5 % ROTATION_VECTOR_LENGTH + (5 / ROTATION_VECTOR_LENGTH) * rotationMatrixDimension] = measuredValue[2]; rotationMatrix[6 % ROTATION_VECTOR_LENGTH + (6 / ROTATION_VECTOR_LENGTH) * rotationMatrixDimension] = gravity[0]; rotationMatrix[7 % ROTATION_VECTOR_LENGTH + (7 / ROTATION_VECTOR_LENGTH) * rotationMatrixDimension] = gravity[1]; diff --git a/services/sensor/hdi_connection/hardware/src/hdi_service_impl.cpp b/services/sensor/hdi_connection/hardware/src/hdi_service_impl.cpp index 19dac19c..f29b4b49 100644 --- a/services/sensor/hdi_connection/hardware/src/hdi_service_impl.cpp +++ b/services/sensor/hdi_connection/hardware/src/hdi_service_impl.cpp @@ -34,7 +34,7 @@ std::vector supportSensors = {0}; float g_testData[] = {9.8F}; SensorEvents testEvent = { .sensorId = 0, - .data = static_cast(g_testData), + .data = reinterpret_cast(g_testData), .dataLen = 4 }; } -- Gitee From 549c20bd8312515ce7d7f200d212d896abef2913 Mon Sep 17 00:00:00 2001 From: bailu1992 Date: Fri, 19 Jan 2024 10:44:15 +0800 Subject: [PATCH 3/6] sensor 3.2-Release Branch alarm Modified Signed-off-by: bailu1992 --- interfaces/native/src/geomagnetic_field.cpp | 42 ++++++++++----------- interfaces/native/src/sensor_algorithm.cpp | 1 + utils/include/sensor_utils.h | 30 +++++++++++++++ 3 files changed, 52 insertions(+), 21 deletions(-) create mode 100644 utils/include/sensor_utils.h diff --git a/interfaces/native/src/geomagnetic_field.cpp b/interfaces/native/src/geomagnetic_field.cpp index 5a76080f..327d003e 100644 --- a/interfaces/native/src/geomagnetic_field.cpp +++ b/interfaces/native/src/geomagnetic_field.cpp @@ -115,9 +115,9 @@ GeomagneticField::GeomagneticField(float latitude, float longitude, float altitu schmidtQuasiNormalFactors = GetSchmidtQuasiNormalFactors(GAUSSIAN_COEFFICIENT_DIMENSION); float gcLatitude = fmax(LATITUDE_MIN + PRECISION, fmin(LATITUDE_MAX - PRECISION, latitude)); CalibrateGeocentricCoordinates(gcLatitude, longitude, altitude); - InitLegendreTable(GAUSSIAN_COEFFICIENT_DIMENSION - 1, static_cast(M_PI / 2.0 - geocentricLatitude)); + InitLegendreTable(GAUSSIAN_COEFFICIENT_DIMENSION - 1, static_cast(M_PI / 2.0 - g_geocentricLatitude)); GetRelativeRadiusPower(); - double latDiffRad = ToRadians(gcLatitude) - geocentricLatitude; + double latDiffRad = ToRadians(gcLatitude) - g_geocentricLatitude; CalculateGeomagneticComponent(latDiffRad, timeMillis); } @@ -142,7 +142,7 @@ std::vector> GeomagneticField::GetSchmidtQuasiNormalFactors(i void GeomagneticField::CalculateGeomagneticComponent(double latDiffRad, int64_t timeMillis) { float yearsSinceBase = (timeMillis - WMM_BASE_TIME) / (365.0f * 24.0f * 60.0f * 60.0f * 1000.0f); - float inverseCosLatitude = DERIVATIVE_FACTOR / static_cast(cos(geocentricLatitude)); + float inverseCosLatitude = DERIVATIVE_FACTOR / static_cast(cos(g_geocentricLatitude)); GetLongitudeTrigonometric(); float gcX = 0.0f; float gcY = 0.0f; @@ -167,9 +167,9 @@ void GeomagneticField::CalculateGeomagneticComponent(double latDiffRad, int64_t * polynomials[row][column] * schmidtQuasiNormalFactors[row][column]; } - northComponent = static_cast(gcX * cos(latDiffRad) + gcZ * sin(latDiffRad)); - eastComponent = gcY; - downComponent = static_cast(-gcX * sin(latDiffRad) + gcZ * cos(latDiffRad)); + g_northComponent = static_cast(gcX * cos(latDiffRad) + gcZ * sin(latDiffRad)); + g_eastComponent = gcY; + g_downComponent = static_cast(-gcX * sin(latDiffRad) + gcZ * cos(latDiffRad)); } } @@ -177,8 +177,8 @@ void GeomagneticField::GetLongitudeTrigonometric() { sinMLongitude[0] = 0.0f; cosMLongitude[0] = 1.0f; - sinMLongitude[1] = static_cast(sin(geocentricLongitude)); - cosMLongitude[1] = static_cast(cos(geocentricLongitude)); + sinMLongitude[1] = static_cast(sin(g_geocentricLongitude)); + cosMLongitude[1] = static_cast(cos(g_geocentricLongitude)); for (uint32_t index = 2; index < GAUSSIAN_COEFFICIENT_DIMENSION; ++index) { uint32_t x = index >> 1; sinMLongitude[index] = (sinMLongitude[index - x] * cosMLongitude[x] @@ -191,7 +191,7 @@ void GeomagneticField::GetLongitudeTrigonometric() void GeomagneticField::GetRelativeRadiusPower() { relativeRadiusPower[0] = 1.0f; - relativeRadiusPower[1] = EARTH_REFERENCE_RADIUS / geocentricRadius; + relativeRadiusPower[1] = EARTH_REFERENCE_RADIUS / g_geocentricRadius; for (int32_t index = 2; index < static_cast(relativeRadiusPower.size()); ++index) { relativeRadiusPower[index] = relativeRadiusPower[index - 1] * relativeRadiusPower[1]; } @@ -207,13 +207,13 @@ void GeomagneticField::CalibrateGeocentricCoordinates(float latitude, float long float slat = static_cast(sin(gdLatRad)); float tlat = slat / clat; float latRad = static_cast(sqrt(a2 * clat * clat + b2 * slat * slat)); - geocentricLatitude = static_cast(atan(tlat * (latRad * altitudeKm + b2) + g_geocentricLatitude = static_cast(atan(tlat * (latRad * altitudeKm + b2) / (latRad * altitudeKm + a2))); - geocentricLongitude = static_cast(ToRadians(longitude)); + g_geocentricLongitude = static_cast(ToRadians(longitude)); float radSq = altitudeKm * altitudeKm + 2 * altitudeKm * latRad + (a2 * a2 * clat * clat + b2 * b2 * slat * slat) / (a2 * clat * clat + b2 * slat * slat); - geocentricRadius = static_cast(sqrt(radSq)); + g_geocentricRadius = static_cast(sqrt(radSq)); } void GeomagneticField::InitLegendreTable(int32_t expansionDegree, float thetaRad) @@ -252,26 +252,26 @@ void GeomagneticField::InitLegendreTable(int32_t expansionDegree, float thetaRad float GeomagneticField::ObtainX() { std::lock_guard geomagneticLock(mutex_); - return northComponent; + return g_northComponent; } float GeomagneticField::ObtainY() { std::lock_guard geomagneticLock(mutex_); - return eastComponent; + return g_eastComponent; } float GeomagneticField::ObtainZ() { std::lock_guard geomagneticLock(mutex_); - return downComponent; + return g_downComponent; } float GeomagneticField::ObtainGeomagneticDip() { std::lock_guard geomagneticLock(mutex_); - float horizontalIntensity = hypot(northComponent, eastComponent); - return static_cast(ToDegrees(atan2(downComponent, horizontalIntensity))); + float horizontalIntensity = hypot(g_northComponent, g_eastComponent); + return static_cast(ToDegrees(atan2(g_downComponent, horizontalIntensity))); } double GeomagneticField::ToDegrees(double angrad) @@ -287,21 +287,21 @@ double GeomagneticField::ToRadians(double angdeg) float GeomagneticField::ObtainDeflectionAngle() { std::lock_guard geomagneticLock(mutex_); - return static_cast(ToDegrees(atan2(eastComponent, northComponent))); + return static_cast(ToDegrees(atan2(g_eastComponent, g_northComponent))); } float GeomagneticField::ObtainLevelIntensity() { std::lock_guard geomagneticLock(mutex_); - float horizontalIntensity = hypot(northComponent, eastComponent); + float horizontalIntensity = hypot(g_northComponent, g_eastComponent); return horizontalIntensity; } float GeomagneticField::ObtainTotalIntensity() { std::lock_guard geomagneticLock(mutex_); - float sumOfSquares = northComponent * northComponent + eastComponent * eastComponent - + downComponent * downComponent; + float sumOfSquares = g_northComponent * g_northComponent + g_eastComponent * g_eastComponent + + g_downComponent * g_downComponent; float totalIntensity = static_cast(sqrt(sumOfSquares)); return totalIntensity; } diff --git a/interfaces/native/src/sensor_algorithm.cpp b/interfaces/native/src/sensor_algorithm.cpp index 2e4eb78c..1d535c41 100644 --- a/interfaces/native/src/sensor_algorithm.cpp +++ b/interfaces/native/src/sensor_algorithm.cpp @@ -18,6 +18,7 @@ #include #include "sensors_errors.h" +#include "sensor_utils.h" using OHOS::HiviewDFX::HiLog; using OHOS::HiviewDFX::HiLogLabel; diff --git a/utils/include/sensor_utils.h b/utils/include/sensor_utils.h new file mode 100644 index 00000000..21362e25 --- /dev/null +++ b/utils/include/sensor_utils.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef SENSOR_UTILS_H +#define SENSOR_UTILS_H + +namespace OHOS { +namespace Sensors { + +template +bool IsEqual(const T &left, const T &right) +{ + return std::abs(left - right) <= std::numeric_limits::epsilon(); +} + +} // namespace Sensors +} // namespace OHOS +#endif // SENSOR_UTILS_H -- Gitee From 2f2e1e566eb3809016d4eba20b0169ecb9258e42 Mon Sep 17 00:00:00 2001 From: bailu1992 Date: Fri, 19 Jan 2024 11:01:42 +0800 Subject: [PATCH 4/6] sensor 3.2-Release Branch alarm Modified Signed-off-by: bailu1992 --- interfaces/native/src/sensor_algorithm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interfaces/native/src/sensor_algorithm.cpp b/interfaces/native/src/sensor_algorithm.cpp index 1d535c41..09e66960 100644 --- a/interfaces/native/src/sensor_algorithm.cpp +++ b/interfaces/native/src/sensor_algorithm.cpp @@ -127,7 +127,7 @@ int32_t SensorAlgorithm::GetAltitude(float seaPressure, float currentPressure, f return OHOS::Sensors::PARAMETER_ERROR; } float coef = 1.0f / RECIPROCAL_COEFFICIENT; - float rationOfStandardPressure = IsEqual(seaPressure, 0.0f) ? + float rationOfStandardPressure = OHOS::Sensors::IsEqual(seaPressure, 0.0f) ? std::numeric_limits::max() : currentPressure / seaPressure; float difference = pow(rationOfStandardPressure, coef); *altitude = ZERO_PRESSURE_ALTITUDE * (1.0f - difference); -- Gitee From 050bf9672fa16f27c6b569e8fa6d1a5c9e5af9c7 Mon Sep 17 00:00:00 2001 From: bailu1992 Date: Tue, 23 Jan 2024 17:32:11 +0800 Subject: [PATCH 5/6] sensor 3.2-Release Branch alarm Modified Signed-off-by: bailu1992 --- interfaces/plugin/test/unittest/ExampleJsunit.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interfaces/plugin/test/unittest/ExampleJsunit.test.js b/interfaces/plugin/test/unittest/ExampleJsunit.test.js index 18dad8b9..7e0c390d 100755 --- a/interfaces/plugin/test/unittest/ExampleJsunit.test.js +++ b/interfaces/plugin/test/unittest/ExampleJsunit.test.js @@ -3118,7 +3118,7 @@ describe("SensorJsTest", function () { } }) - var getGeomagneticDipResult = [ 0.8760581016540527, 0.862170, -Infinity, 44330] + var getGeomagneticDipResult = [0.8760581016540527, 0.862170, -953042337792, 44330] /* * @tc.name: Sensor_GetGeomagneticDip_001 -- Gitee From 087ce8e308308c33d02272c20b9f2938ddf9252c Mon Sep 17 00:00:00 2001 From: bailu1992 Date: Thu, 25 Jan 2024 16:08:26 +0800 Subject: [PATCH 6/6] sensor 3.2-Release Branch alarm Modified Signed-off-by: bailu1992 --- interfaces/native/src/geomagnetic_field.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/interfaces/native/src/geomagnetic_field.cpp b/interfaces/native/src/geomagnetic_field.cpp index 327d003e..1ea59a3a 100644 --- a/interfaces/native/src/geomagnetic_field.cpp +++ b/interfaces/native/src/geomagnetic_field.cpp @@ -191,7 +191,8 @@ void GeomagneticField::GetLongitudeTrigonometric() void GeomagneticField::GetRelativeRadiusPower() { relativeRadiusPower[0] = 1.0f; - relativeRadiusPower[1] = EARTH_REFERENCE_RADIUS / g_geocentricRadius; + relativeRadiusPower[1] = OHOS::Sensors::IsEqual(g_geocentricRadius, 0.0f) ? std::numeric_limits::max() : + EARTH_REFERENCE_RADIUS / g_geocentricRadius; for (int32_t index = 2; index < static_cast(relativeRadiusPower.size()); ++index) { relativeRadiusPower[index] = relativeRadiusPower[index - 1] * relativeRadiusPower[1]; } -- Gitee