资源简介

Delaunay三角划分的Matlab实现 main为运行文件,点集可以在point内修改

资源截图

代码片段和文件信息

function cont = findtri( tripointpointxpointy )
%FINDTRI Summary of this function goes here
%   Detailed explanation goes here
num=size(tri1);
for i=1:1:num
    temp1=abs((point(tri(i1)1)*point(tri(i2)2)+point(tri(i1)2)*point(tri(i3)1)+point(tri(i2)1)*point(tri(i3)2)-point(tri(i1)1)*point(tri(i3)2)-point(tri(i1)2)*point(tri(i2)1)-point(tri(i2)2)*point(tri(i3)1))/2);
    temp2=abs((pointx*point(tri(i2)2)+pointy*point(tri(i3)1)+point(tri(i2)1)*point(tri(i3)2)-pointx*point(tri(i3)2)-pointy*point(tri(i2)1)-point(tri(i2)2)*point(tri(i3)1))/2);
    temp3=abs((point(tri(i1)1)*pointy+point(tri(i1)2)*point(tri(i3)1)+pointx*point(tri(i3)2)-point(tri(i1)1)*point(tri(i3)2)-point(tri(i1)2)*pointx-pointy*point(tri(i3)1))/2);
    temp4=abs((point(tri(i1)1)*point(tri(i2)2)+point(tri(i1)2)*pointx+point(tri(i2)1)*pointy-point(tri(i1)1)*pointy-point(tri(i1)2)*point(tri(i2)1)-point(tri(i2)2)*pointx)/2);
    if temp1/(temp2+temp3+temp4)>0.95&&temp1/(temp2+temp3+temp4)<1.05
        cont=i;
    end
end
end


 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件        1091  2012-02-05 11:37  findtri.m
     文件        3256  2012-02-05 11:29  flip.m
     文件        3519  2012-04-19 16:44  main.m
     文件          59  2012-02-03 18:17  points.txt

评论

共有 条评论