boundingbox.m

来自「computation of conformal maps to polygon」· M 代码 · 共 17 行

M
17 行
字号
function box = boundingbox(p)
%BOUNDINGBOX Smallest box that contains the polygon.
%   BOUNDINGBOX(P) returns the smallest box (in AXIS format) that contains
%   the polygon P. If P is unbounded, all the entries will be infinite.
%
%   See also POLYGON/DIAM.
%
%   Copyright 2003 by Toby Driscoll.
%   $Id: boundingbox.m 266 2003-04-25 18:46:31Z driscoll $

if ~isinf(p)
  z = vertex(p);
  box = [ min(real(z)) max(real(z)) min(imag(z)) max(imag(z)) ];
else
  % We might find some finite bounds. But is there any application for this?
  box = [ -Inf Inf -Inf Inf ];
end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?