What is PJA Toolkit ? PJA (Pure Java AWT) Toolkit is a JavaTM library for drawing graphics developed by eTeks. It is 100% Pure Java and doesn't use any native graphics resource of the system on which the Java Virtual Machine runs. java.awt.Graphics
一、Bresenham圆扫描转换
圆的八对称性:
根据圆的对称性,可以用四条对称轴x=0,y=0,x=y,x=-y将圆分成8等份。只要绘制出第一象限内的1/8圆弧,根据对称性就可绘制出整圆,这称为八分法画圆算法。假定第一象限内的任意点为P(x,y),可以顺时针确定另外7个点:P(y,x),P(-y,x),P(x,-y),P(-x,-y),P(-y,-x),P(y,-x),P(-x,y)。
绘制第一象限内的1/8圆弧的算法如下:
1.初始化,x=0,y=r,d=3-2r
2.当 xi < y