trin2d.m
来自「细胞生长结构可视化工具箱-MATLAB Toolbox1999.zip」· M 代码 · 共 15 行
M
15 行
function [n12d,n22d,n32d,b1,b2] = trin2d(n1,n2,n3)
% Find two orthogonal basis vectors for the plane containing the triangle
b1 = n2-n1;
% find projection of n3-n1 onto b1
proj = (dot(n3-n1,b1)/dot(b1,b1))*b1;
% subtract this from n3-n1 to find second basis function orthogonal to b1
b2 = (n3-n1)-proj;
% can now express pts in traingle in form n1 +xb1 +yb2 => 2-D coords
n12d = [0,0];
n22d = [(n2-n1)/b1,(n2-n1)/b2];
n32d = [(n3-n1)/b1,(n3-n1)/b2];
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?