refactored circle and arc with curve function