raster-algorithms
raster-algorithms
Void lineDDA (int xa, int ya, int xb, int yb)
{
int dx = xb – xa, dy = yb – ya, steps, k;
float xincrement, yincrement, x = xa, y = ya;
if (abs(dx)>abs(dy))
{
Steps = abs (dx);
}
else
{
Steps = abs (dy);
}
xincrement = dx/(float) steps;
yincrement = dy/(float) steps;
7. Move each calculated pixel position (𝑥, 𝑦) onto the elliptical path centered on
(𝑥𝑐 , 𝑦𝑐 ) and plot the coordinate values:
𝑥 = 𝑥 + 𝑥𝑐 , 𝑦 = 𝑦 + 𝑦𝑐