Reputation: 72
Does the speed of the mid point circle algorithm improve if we divide the circle into 16 parts rather than the 8 parts given in the general algorithm.please give explanation for either case
Upvotes: 1
Views: 277
Reputation: 11910
If you divide circle into 16 pieces rather than 8, you make 1 extra mirroring operation while decreasing the mirrored pie to half. If performance gain due to halving the pie is greater than the extra-mirroring slow-down, then you should use 16 pieces.
Dividing circle into 2 parts:
1 x 180degree computing and 180degree mirroring.
Dividing circle into 4 parts:
1 x 90degree computing and
90degree mirroring x1
180degree mirroring x1
Dividing circle into 8 parts:
1x 45degree computing and
1x 45degree mirroring.
1x 90degree mirroring.
1x 180 degree mirroring.
Dividing circle into 16 parts:
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.
its like exchanging 22.5 degree mirroring with 22.5 degree calculating
But, mirroring smaller angles is more complex than mirroring 90degree angles.
Upvotes: 2