C/C++

C/ CPP programms

Implementation of Reflection Transformation

SOURCE CODE : //programed by Paras Wadher MCA Nagpur university /* A C++ program to illustrate the implementation of Reflection Transformation about x-axix, y-axis and w.r.t origin. */ # include <iostream.h> # include <graphics.h> # include <conio.h> # include <math.h> //———————– Function Prototypes ————————-// void show_screen( ); void apply_reflection_along_x_axis(const int,int []); void apply_reflection_along_y_axis(const int,int []); …

Implementation of Reflection Transformation Read More »

interpretetion of Bresenhams alogorithm

SOURCE CODE : //programed by Paras Wadher MCA Nagpur university //program for create a display file and interprete it using Bresenhams algo . #include<iostream.h> #include<conio.h> #include<graphics.h> #include<alloc.h> #include<process.h> #include<stdlib.h> class display { public : int HEIGHT_START,WIDTH_START;//Starting indices of frame buffer int HEIGHT_END,WIDTH_END;//Ending indices of frame buffer int WIDTH,HEIGHT;//Dimenssion of frame int DF_OP[100],DF_X[100],DF_Y[100],FREE,DFSIZE; int FRAME,START,COUNT,INDEX; int …

interpretetion of Bresenhams alogorithm Read More »

Bresenhams alogorithm for line

SOURCE CODE : //programed by Paras Wadher MCA Nagpur university //Program for implement Bresenhams alogorithm for doted line #include<c:\tc\axis.cpp>//included from https://paraswadher.com/2009/04/draw-axis-on-screen-in-cdraw-axis-on-screen-in-c/ #include<iostream.h> #include<conio.h> #include<graphics.h> #include<stdlib.h> class brese { private : int x,x0,x1,x2,xa,xb,y,y0,y1,y2,ya,yb,dx,dy,s1,s2,temp,interc,error; public : void initgraph1(void); void getdata(void); void bresenhams(void); }; void brese :: initgraph1(void) { int gd = DETECT, gm; initgraph(&gd,&gm,”c:\\tc\\bgi”); } void brese …

Bresenhams alogorithm for line Read More »

Draw axis on screen in c++

SOURCE CODE : //programed by Paras Wadher MCA Nagpur university //program To Draw axis on the screen #include<iostream.h> #include<conio.h> #include<graphics.h> #include<stdlib.h>//for itoa() class axis { private : int x,y,x1,y1,x2,y2; public : void initgraph1(void); void drawaxis(void); }; void axis :: initgraph1(void) { int gd = DETECT, gm; initgraph(&gd,&gm,”c:\\tc\\bgi”); } void axis :: drawaxis(void) { /* putpixel(0,0,WHITE);//upper …

Draw axis on screen in c++ Read More »

VAM (Vogel Approximation Method) in C++

SOURCE CODE : //programed by Paras Wadher MCA Nagpur university //program for Vogell’s Approximation Method (VAM) #include<iostream.h> #include<conio.h> #include<iomanip.h> class VAM { private: int A[100][100],B[100],C[100],i,j,m,n,sum1,sum2,S; int small1,small2,small,small3,large1,large2,large3,middle1; int middle2,middle3,large; int csmall1,csmall2,csmall,csmall3,clarge1,clarge2,clarge3,cmiddle1; int cmiddle2,cmiddle3,clarge; int penalty; public: void getdata(void); void display(void); void calculate(void); }; void VAM::getdata(void) { cout<<“\n\n Enter the size of cost matrix… “; cout<<“\n\n …

VAM (Vogel Approximation Method) in C++ Read More »

Cartesian Slope-Intercept Equation

SOURCE CODE : //programed by Paras Wadher MCA Nagpur university /*program to draw a line using Cartesian Slope-Intercept Equation [ Simple Implementation ].*/ # include <iostream.h> # include <graphics.h> # include <conio.h> # include <math.h> void show_screen( ); void slope_intercept_line(const int,const int,const int,const int); int main( ) { int driver=VGA; int mode=VGAHI; int x_1=0; int …

Cartesian Slope-Intercept Equation Read More »