Modern_Robotics/packages/Matlab/mr/NearZero.m

17 lines
278 B
Matlab

function judge = NearZero(near)
% *** BASIC HELPER FUNCTIONS ***
% Takes a scalar.
% Checks if the scalar is small enough to be neglected.
% Example Input:
%
% clear; clc;
% near = -1e-7;
% judge = NearZero(near)
%
% Output:
% judge =
% 1
judge = norm(near) < 1e-6;
end