Skip to content

Commit e0fbe88

Browse files
committed
using Math.hypot(x, y, z) instead of Math.sqrt(x*x + y*y + z*z)
1 parent 5cb0221 commit e0fbe88

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/flightlog.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@ export function FlightLog(logData) {
913913
const Vn = srcFrame[gpsVelNED[0]],
914914
Ve = srcFrame[gpsVelNED[1]],
915915
Vd = srcFrame[gpsVelNED[2]];
916-
const velocity = Math.sqrt(Vn * Vn + Ve * Ve + Vd * Vd);
916+
const velocity = Math.hypot(Vn, Ve, Vd);
917917
const minVelo = 5; // 5cm/s limit to prevent division by zero and miss tiny noise values
918918
let trajectoryTiltAngle = 0;
919919
if (velocity > minVelo) {

0 commit comments

Comments
 (0)