Midpoint Circle Algorithm With Derivation