<s>
In	O
computer	O
graphics	O
,	O
the	O
midpoint	B-Algorithm
circle	I-Algorithm
algorithm	I-Algorithm
is	O
an	O
algorithm	O
used	O
to	O
determine	O
the	O
points	O
needed	O
for	O
rasterizing	O
a	O
circle	O
.	O
</s>
<s>
Bresenham	B-Algorithm
's	I-Algorithm
circle	I-Algorithm
algorithm	I-Algorithm
is	O
derived	O
from	O
the	O
midpoint	B-Algorithm
circle	I-Algorithm
algorithm	I-Algorithm
.	O
</s>
<s>
Because	O
in	O
a	O
continuous	O
function	O
,	O
the	O
function	O
for	O
a	O
sphere	O
is	O
the	O
function	O
for	O
a	O
circle	O
with	O
the	O
radius	O
dependent	O
on	O
(	O
or	O
whatever	O
the	O
third	O
variable	O
is	O
)	O
,	O
it	O
stands	O
to	O
reason	O
that	O
the	O
algorithm	O
for	O
a	O
discrete(voxel )	O
sphere	O
would	O
also	O
rely	O
on	O
this	O
Midpoint	B-Algorithm
circle	I-Algorithm
algorithm	I-Algorithm
.	O
</s>
<s>
These	O
frequent	O
integer	O
additions	O
do	O
not	O
limit	O
the	O
performance	B-Device
much	O
,	O
as	O
those	O
square	O
(	O
root	O
)	O
computations	O
can	O
be	O
spared	O
in	O
the	O
inner	O
loop	O
in	O
turn	O
.	O
</s>
<s>
Just	O
as	O
with	O
Bresenham	B-Algorithm
's	I-Algorithm
line	I-Algorithm
algorithm	I-Algorithm
,	O
this	O
algorithm	O
can	O
be	O
optimized	O
for	O
integer-based	O
math	O
.	O
</s>
<s>
To	O
draw	O
only	O
a	O
certain	O
arc	O
from	O
an	O
angle	O
to	O
an	O
angle	O
,	O
the	O
algorithm	O
needs	O
first	O
to	O
calculate	O
the	O
and	O
coordinates	O
of	O
these	O
end	O
points	O
,	O
where	O
it	O
is	O
necessary	O
to	O
resort	O
to	O
trigonometric	O
or	O
square	B-Library
root	I-Library
computations	I-Library
(	O
see	O
Methods	B-Library
of	I-Library
computing	I-Library
square	I-Library
roots	I-Library
)	O
.	O
</s>
<s>
Then	O
the	O
Bresenham	B-Algorithm
algorithm	I-Algorithm
is	O
run	O
over	O
the	O
complete	O
octant	O
or	O
circle	O
and	O
sets	O
the	O
pixels	O
only	O
if	O
they	O
fall	O
into	O
the	O
wanted	O
interval	O
.	O
</s>
