Data Modle: Detect a point if it's inside a nodes-map

Data Modle: Detect a point if it's inside a nodes-map

1- Search all triangles in the nodes-map

[Algorithm 1]

s0 - Start.

s1- Let point P(i) = (x(i), y(i)), points set {P(i)};

       Let line L(i) = (P(i), P(i+1)), lines set {L(i)};

       Let triangle T(i) = (P(i), P(i+1), P(i+2)), triangle set {T(i)};

s2- Find  Min(y) in {P(i)}, if find P(k), goto s6;

s3- Find  Max(y) in {P(i)}, if find P(k), goto s6; 

s4- Find  Min(x) in {P(i)}, if find P(k), goto s6; 

s5- Find  Max(x) in {P(i)}, if find P(k), goto s6; 

s6- Let T(k-1) = (P(k-1), P(k), P(k+1)), k > = 2,

       Let points set {P(h)}, not includes P(k-1), P(k) and P(k+1),

       If there is a P(h) in T(k-1), goto s3 or s4 or s5;

       Find a triangle T(k-1),

       If only 3 points in {P(i)} = (P(k-1), P(k), P(k+1)), goto s7;

       Delete P(k) from {P(i)},

       Delete L(k-1), L(k) from {L(i)},

       Add L(k-1) = (P(k-1), P(k+1)) into {L(i)},

      goto s2;

s7- End;

2- Detect a point if it's inside a triangle of the nodes-map

BR,

Mars

June 22, 2013

If you want to discuss with me for this article, please feel free to

E-me: mars.fu@foxmail.com.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值