Modern_Robotics/packages/Matlab/mr/NearZero.m

18 lines
279 B
Matlab

%*** BASIC HELPER FUNCTIONS ***
function judge = NearZero(near)
% 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