This tutorial describes how to use piecewise cubic B\'ezier curves to draw arbitrarily oriented ellipses and elliptical arcs. The geometric principles discussed here result in strikingly simple interfaces for graphics functions that can draw (approximate) circles, ellipses, and arcs of circles and ellipses. C++ source code listings are included for these functions. Their code size can be relatively small because they are designed to be used with a graphics library or platform that draws B\'ezier curves, and the library or platform is tasked with the actual rendering of the curves.
翻译:本教程阐述了如何利用分段三次贝塞尔曲线绘制任意方向的椭圆与椭圆弧。文中探讨的几何原理为图形函数提供了极其简洁的接口设计,使其能够绘制(近似)圆、椭圆及圆与椭圆的弧段。本文附带了实现这些函数的C++源代码。由于这些函数设计为与绘制贝塞尔曲线的图形库或平台配合使用,实际曲线渲染任务由库或平台承担,因此其代码规模可保持相对精简。