Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<graphics.h>
- #include<iostream.h>
- #include<conio.h>
- #include<math.h>
- void main()
- {
- int x1,y1,x2,y2,xn,yn;
- double th;
- float t;
- int gd=DETECT,gm;
- initgraph(&gd,&gm,"C:\\TurboC3\\BGI");
- cout<<"Enter the first co-ordinate:";
- cin>>x1>>y1;
- cout<<"Enter second co-ordinate:";
- cin>>x2>>y2;
- line(x1,y1,x2,y2);
- cout<<"Enter the angle:";
- cin>>th;
- t=(22*th)/(180*7);
- xn=abs((x2*cos(t))-(y2*sin(t)));
- yn=abs((x2*sin(t))+(y2*cos(t)));
- line(x1,y1,xn,yn);
- getch();
- closegraph();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement