Quasi-Euclidean Norm

버전 3.0.0 (1.5 KB) 작성자: Moreno, M.
Returns the quasi-euclidean norm of an array in 1, 2 or 3 dimensions.
다운로드 수: 14
업데이트 날짜: 2022/3/20

라이선스 보기

Calling [x, e] = qnorm(X, dim) returns the quasi-euclidean norm of X along its rows or columns for dim = 1 or 2, respectively, and the calculation error compared to the Euclidean norm. The values are derived from the information of neighbourhoods using 1, 2 or 3D distance transforms in (1), (2 2) or (3 3 3) voxel models.
The coefficients or weights are calculated seeking to maximise the norm of the vector X (approaching the L2 norm value within a small error). This makes this function a good approximation for the euclidean distance without the need for square roots or powers.
An example of the use of this function is:
n = 200;
[x, y, z] = meshgrid(-1 : 2 / (n - 1) : 1);
d = zeros(size(x));
for i = 1 : n
for j = 1 : n
for k = 1 : n
d(i, j, k) = qnorm([x(i, j, k) y(i, j, k) z(i, j, k)]);
end
end
end
s = isosurface(x, y, z, d, 0.5);
p = patch(s);
isonormals(x, y, z, d, p)
view(3)
set(p, 'FaceColor', [0.85 0.85 0.85])
set(p, 'EdgeColor', 'none')
axis equal
camlight
lighting gouraud

인용 양식

Moreno, M. (2025). Quasi-Euclidean Norm (https://www.mathworks.com/matlabcentral/fileexchange/108209-quasi-euclidean-norm), MATLAB Central File Exchange. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R2022a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
3.0.0

Trivial case residual update

2.0.0

Specified a dimension for the norm calculation, and added as an output the error compared to the Euclidean norm.

1.0.0