Circle Generation by Mid Point Methods

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

DEHRADUN INSTITUTE OF

TECHNOIOGY

LABORATORY
MANUAL

PRACTICAL INSTRUCTION SHEET


EXPERIMENT TITLE. : Experiment on generation of circle

and line by c-programming


EXPERIMENT No
: 02

ISSUE NO.:

ISSUE DATE:

REV No.:

REV. DATE:

Page :

LABORATORY:
CAD LAB

SEMESTER : VIth

DEPTT. Mechanical
Engg.

# include<graphics.h>
#include<stdio.h>
#include<iostream.h>
#include<conio.h>
# include<math.h>
#include<dos.h>
#include<c:\graph/co_axis.h
Void main()
{

1/5

/*request auto detection*/


Int gdriver=VGA,gmode=VGAHI;
Int I,r,dx,dy,x,y,Cx,Cy;
Void coordinate_axis();
Clrscr();
Prepared by: Mr shwetabh singh

Approved by: DR Y.K.Tyagi

DEHRADUN INSTITUTE OF
TECHNOIOGY, Dehradun

LABORATORY
MANUAL

PRACTICAL INSTRUCTION SHEET


EXPERIMENT TITLE. : W.A.P to find axial load and deflection in
spring in c programming
EXPERIMENT No
: 04

ISSUE NO.:

ISSUE DATE:

REV No.:

REV. DATE:

Page :

LABORATORY:
CAD LAB

SEMESTER : VIth

DEPTT. Mechanical
Engg.

/*initialize graphics and local variable*/


Initgraph(&gdriver, &gmode,\\tc\\bgi);
Cout<<\n\n\t\tEnter the center(Cx,Cy) of circle.;
Cin>>Cx>>Cy;
2

2/5

Cout<<\n\n\t\tEnter the radius(r) of circle.;


Cin>>r;
Cx+=getmaxx()/2,Cy+=getmaxy()/2;
X=0,y=r;
P=1-r;
Coordinate_axis();
Putpixel(Cx,Cy,10);
For(i=0:x<y;i=i+1)
{ If(p<0)
X=x+1,p=p+2*x+1;
Else
Prepared by: Mr shwetabh singh

Approved by: DR Y.K.Tyagi

DEHRADUN INSTITUTE OF
TECHNOIOGY, Dehradun

LABORATORY
MANUAL

PRACTICAL INSTRUCTION SHEET


EXPERIMENT TITLE. : W.A.P to find axial load and deflection in
spring in c programming
EXPERIMENT No
: 04

ISSUE NO.:

ISSUE DATE:

REV No.:

REV. DATE:

Page :

3/5

DEPTT. Mechanical
Engg.

LABORATORY:
CAD LAB

SEMESTER : VIth

{
X=x+1,y=y-1;
P=p+2*x+1-2*y;
Putpixel(Cx+x,Cy+y,12);
Putpixel(Cx+y,Cy+x,12);
Putpixel(Cx-x,Cy+y,12);
Putpixel(Cx+x,Cy-y,12);
Putpixel(Cx-x,Cy+y,12);
Putpixel(Cx+y,Cy-X,12);
Putpixel(Cx-x,Cy-y,12);
Putpixel(Cx-y,Cy-x,12);
Getch();
Closegraph();
}
Prepared by: Mr shwetabh singh

Approved by: DR Y.K.Tyagi

DEHRADUN INSTITUTE OF
TECHNOIOGY, Dehradun

LABORATORY
MANUAL

PRACTICAL INSTRUCTION SHEET

EXPERIMENT TITLE. : W.A.P to find axial load and deflection in


spring in c programming
EXPERIMENT No
: 04

ISSUE NO.:

ISSUE DATE:

REV No.:

REV. DATE:

Page :

LABORATORY:
CAD LAB

SEMESTER : VIth

DEPTT. Mechanical
Engg.

Write a c program for generation of line


# include<graphics.h>
#include<stdio.h>
#include<iostream.h>
#include<conio.h>
# include<math.h>
#include< c:\graph/bresh_in.h >
#include<c:\graph/co_axis.h
Void main()
{ /request auto detection/
Int gdriver=DETECT,gmode;
Void bresline(int,int,int,int);
Int xa,Ya,Xb,Yb;
Void coordinate_axis();
Clrscr();
Prepared by: Mr shwetabh singh

Approved by: DR Y.K.Tyagi


5

4/5

DEHRADUN INSTITUTE OF
TECHNOIOGY, Dehradun

LABORATORY
MANUAL

PRACTICAL INSTRUCTION SHEET


EXPERIMENT TITLE. : W.A.P to find axial load and deflection in
spring in c programming
EXPERIMENT No
: 04

ISSUE NO.:

ISSUE DATE:

REV No.:

REV. DATE:

Page :

LABORATORY:
CAD LAB

SEMESTER : VIth

DEPTT. Mechanical
Engg.

Initgraph(&gdriver,&gmode,d:\\tc\\bgi);
Printf(\n Enter the first coordinate);
Scanf(%d%d&Xa&Ya);
Printf(\n Enter the second coordinate);
Scanf(%d%d&Xb&Yb);
Coordinate _axis();
Bresline(Xa,Ya,Xb,Yb);
Getch();
Closegraph();
}
6

5/5

Prepared by: Mr shwetabh singh

Approved by: DR Y.K.Tyagi

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy