orthotangencies.m

来自「Matlab程序」· M 代码 · 共 18 行

M
18
字号
function [aInd,bInd, pA, pB] = OrthoTangencies( thePoly, epiDirection)


if ( size(thePoly,1) ~= 2 )
    error('thePoly must have 2 rows')
end

if ( any(size(epiDirection) ~= [2 1] ) )
    error('epiDirection must be 2x1')
end

thePolyAlignedX = [-epiDirection(2),epiDirection(1)] * thePoly;

[dummy, aInd] = max(thePolyAlignedX);
[dummy, bInd] = min(thePolyAlignedX);

pA = thePoly(:,aInd);
pB = thePoly(:,bInd);

⌨️ 快捷键说明

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