中点圆算法的速度提高

时间:2012-08-07 10:42:45

标签: algorithm geometry

如果我们将圆分为16个部分而不是通用算法中给出的8个部分,那么中点圆算法的速度是否会提高。请对这两种情况进行解释

1 个答案:

答案 0 :(得分:2)

如果将圆分为16个而不是8个,则进行1次额外的镜像操作,同时将镜像饼减半。如果由于将馅饼减半而导致的性能提升大于额外镜像减速,那么你应该使用16件。

将圆圈分成两部分:

 1 x 180degree computing and 180degree mirroring.

将圆圈分为4个部分:

1 x 90degree computing and 
90degree mirroring x1 
180degree mirroring x1 

将圆圈分为8个部分:

 1x 45degree computing and 
 1x 45degree mirroring.
 1x 90degree mirroring.
 1x 180 degree mirroring.

将圆圈分成16个部分:

 1x 22.5degree computing (half of before) +performance
 1x 22.5degree mirroring.(an extra from before) -performance
 1x 45degree mirroring.
 1x 90 degree mirroring.
 1x 180 degree mirroring.
它像22.5度计算交换22.5度镜像

但是,镜像较小的角度比镜像90度角更复杂。

相关问题