// pixelcalc.cpp : Interpolates pixels between specified endpoints. // #include // system header file containing declarations for C++ IO classes //#include // systemm header file for IO manipulation classes #include // system header file containing declarations for C++ string class // calcPixel - elementary pixel calculation using variation of y=mx+b void calcPixel( int x0, int xn, int y0, int yn ) { for( int ix=x0; ix<=xn; ix++ ) { float fy = y0 + float(yn-y0)/float(xn-x0)*ix; // note f.p. division for each calculation int iy = fy+0.5; // round to nearest whole integer cout << ix << "," << iy << stl::endl; } }