answersLogoWhite

0


Best Answer

#include<stdio.h>

#include<conio.h>

#include<graphics.h>

#include<ctype.h>

#include<math.h>

#include<stdlib.h>

void draw(int x1,int y1,int x2,int y2);

void main()

{

int x1,y1,x2,y2;

int gdriver=DETECT,gmode,gerror;

initgraph(&gdriver,&gmode,"c:\\tc\\bgi:");

printf("\n Enter the x and y value for starting point:\n");

scanf("%d%d",&x1,&y1);

printf("\n Enter the x and y value for ending point:\n");

scanf("%d%d",&x2,&y2);

printf("\n The Line is shown below: \n");

draw(x1,y1,x2,y2);

getch();

}

void draw(int x1,int y1,int x2,int y2)

{

float x,y,xinc,yinc,dx,dy;

int k;

int step;

dx=x2-x1;

dy=y2-y1;

if(abs(dx)>abs(dy))

step=abs(dx);

else

step=abs(dy);

xinc=dx/step;

yinc=dy/step;

x=x1;

y=y1;

putpixel(x,y,1);

for(k=1;k<=step;k++)

{

x=x+xinc;

y=y+yinc;

putpixel(x,y,2);

}

}

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Line drawing simple dda algorithm in c?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Movies & Television

What can most of African's language be traced to?

France


Which road permit is required for all states in India?

VAT FORMS/WAY BILLS REQUIRED FOR DIFFERENT STATES IN INDIA Sl N. State Type of Form/permit required Entry Tax T.P. /Ba hati Remark (for more information, please visit the website given below) INWARD OUTWARD 01 Andhra Pradesh Form X or 600 Form 602 Yes Yes www.apct.gov.in 02 Arunachal Pradesh Form DG-01 N.A. No No Arun-taxexcise.nic.in 03 Assam Form 61 (Delivery Note for resale) Road Permit in Form 62 Form 60 Yes Yes www.tax.assam.gov.in 04 Bihar Form D-IX for value &gt; 10,000/- Form D-X for value &gt; 10,000/- No www.biharcommercialtax.gov .in 05 Chandigarh Only TIN No No No Chandigarh.nic.in/dept_excise 06 Chhattisgarh TIN No. starting with 22&hellip;&hellip;&hellip;. N.A. No No Cg.nic.in/comtex/ 07 Daman &amp; Diu N.A. N.A. No No 08 Delhi N.A. N.A. No No Delhi.gov.in/DVAT Forms 09 Goa From VAT XX N.A. No No www.goacomtax.gov.in 10 Gujarat Form 403 Form 402 No No Commercialtax.gujarat.gov.in 11 Haryana Form VAT D3/ST 38 Inward Form VAT D3 Outward Yes No www.haryanatax.com 12 Himachal Pradesh Form e-VAT XXVI-A Form e-VAT XXVI-A No Yes hptax.gov.in 13 Jammu &amp; Kashmir Declaration Form 65 for value &gt; 5000 Waybill Form 58 Form 65 Yes No jkcomtax.nic.in 14 Jharkhand Form JVAT 504G (Green Colour) Form 504 B (Blue colour) No No www.jharkhandcomtax.nic.in 15 Karnataka e-SUGAM FORM (On line Goods Movement Permit) Yes Yes Yes Ctax.kar.nic.in 16 Kerala Form 8 F Form 15/16 for Non- Registered dealer Form 15 - Delivery Note Yes keralataxes.gov.in 17 Madhya Pradesh Declaration Form 49 &hellip; 2 Copies Declaration Form 50, if Consignor &amp; Consignee is same &hellip; 2 Copies Declaration Form 49/50 Yes Yes www.mptax.net 18 Maharashtra Form N for Octroi Form N for Octroi No No mahavat.gov.in 19 Manipur Form 27 Form 28 Yes No www.manipurvat.gov.in 20 Meghalaya Form 35, Form 40-Road Permit Form 37 No No megvat.gov.in 21 Mizoram Form 33 Way Bill N.A. No No www.mizoram.nic.in 22 Nagaland Form VAT 23 Form VAT 24 No No www.nagalandtax.nic.in 23 Orissa Form VAT 402/402A N.A. Yes Yes as.ori.nic.in 24 Puducherry N.A. N.A. No No gst.puducherry.gov.in 25 Punjab Form VAT 36 VAT 11/12 for Casual Dealer Form VAT 36 Yes Yes www.pextax.com 26 Rajasthan VAT 47 VAT 49 Yes No rajtax.gov.in 27 Sikkim Form 25 Way Bill &hellip; 3 Copies Form 26 Form 25 Form 26 No www.sikkimtax.gov.in 28 Tamil Nadu Commercial Invoice with copy of BOE In case of imported goods. N.A. No Yes www.tnvat.gov.in 29 Tripura Form XXIV(Permit)/ XXVI(Intimation) Form XXV (Declaration by Transporter) Form XXVI No No tripurataxes.nic.in 30 Uttara khand Form 16 Form 17 N.A. No Yes comtax.uk.gov.in 31 Uttar Pradesh Form 38/39 N.A. Yes Yes comtax.up.nic.in 32 West Bengal Form 50 Form 51 No Yes www.wbcomtax.nic.in General Requirements: Any consignment booked for any other state of India should have with the following documents: - 1. Four copies of invoice (1 original + 3 Copies). 2. TIN no. and the CST no. of the consignor and consignee are mandatory where applicable. Consignor and consignee are responsible to provide active TIN no. 3. Way Bill/Road Permit/VAT Form as above. 4. Consignments dispatched to individuals who do not have CST &amp; TIN nos., a declaration from the consignee that the goods are not for sale and for personal consumption apart from other conditions as laid down in respective States VAT Regulations. In all states where VAT is implemented TIN number in place of LST No. is a must. Dated% 28-05-2012 List of documents required for Indian Custom Clearance as well as Nepal Custom Clearance in case of export from India to Nepal: - Sl. No. Scheme/Item Documents required from Consignor Documents required from Consignee 01 General Trading (Export by Traders) = Invoice (3 copies), = Packing List (3 copies), = Import Export Code Certificate Copy-if value is 25000/- or &gt; 25000/-, = Bill of Export (Original, Duplicate &amp; Triplicate) = Authority Letter in f/o clearing agent-if Value is &gt; Rs. 10.00 lac. Income Tax Registration Copy, VAT Registration Copy, &amp; Industrial Registration Copy. 02 Excisable goods (Export by Mfrs) In Indian Rs.) = Commercial Invoice-2 copies, = Packing-1 copy, = Excise Invoice (Duplicate for Transporter), = Nepal Invoice (Form A.R.E.-1)-Original, Duplicate &amp; Triplicate-duly endorsed by Central Excise Officer or self-attested, = IEC Certificate Copy, = Bill of Export-Org., Dup. &amp; Triplicate. Income Tax Registration Copy, VAT Registration Copy, Industrial Registration Copy + Letter of Credit, if the export is made under L/C. 03 Export by Mfrs Under L/C in US$ = Excise Invoice-Duplicate for Transporter, = Packing list-1 copy, = Form-ARE1-Org., Dup. &amp; Tri.- duly endorsed by Central Excise Office, = Certificate of Origin, = IEC Certificate Copy, = Bill of Export (Org., Dup. &amp; Tri.) = Commercial Invoice for US$ =L/C = Performa Invoice Income Tax Registration Copy, VAT Registration Copy, Industrial Registration Copy + Letter of Credit, if the export is made under L/C. 04 BOND in I.Rs. = 4 Copies of ARE-1 (Bond No. should be mentioned in ARE-1 with sign &amp; stamp of Central Excise officer), = Excise Invoice (Duplicate for transporter), = IEC No., = Commercial Invoice, = Packing List, = Certificate of Origin, = Performa Invoice = L.C. (Letter of Credit) = Bill of Export (Org., Dup., &amp; Triplicate) PAN, Authority Letter, Bank D.O. 05 Draw Back Scheme = 4 Copies of ARE-1 (Bond No. should be mentioned in ARE-1 with sign &amp; stamp of Central Excise officer), = Excise Invoice (Duplicate for transporter), = IEC No., = 4 Copies of Commercial Invoice, = 4 Copies of Packing List, = Authority Letter addressing Land Custom Station authorizing CHA, = Certificate of Origin, = Test Report, = ISO Certificate, = Performa Invoice, = L.C. (Letter of Credit), = Draw Back Declaration with DBK Sl. No. = Bill of Export (Org., Dup., &amp; Triplicate) PAN, Authority Letter &amp; Bank D.O. 06 DES Scheme = 4 Copies of ARE-1 (Bond No. should be mentioned in ARE-1 with sign &amp; stamp of Central Excise officer), = Excise Invoice (Duplicate for transporter), = IEC No., = 4 Copies of Commercial Invoice, = 4 Copies of Packing List, = Authority Letter addressing Land Custom Station authorizing CHA, = Certificate of Origin, = Test Report, = ISO Certificate, = Performa Invoice, = L.C. (Letter of Credit), = DES Declaration with DES Sl. No., = Advance License Copy. = Bill of Export (Org., Dup., &amp; Triplicate) PAN, Authority letter &amp; Bank D.O. 07 Chasis (New) Bill, IEC No., Packing List PAN, Authority Letter &amp; a letter from The Ministry of Transportation. 08 Old Machinery Bill, IEC No. &amp; Packing List PAN, Authority Letter &amp; a letter from The Ministry of Environment. 09 Medicine Bill, Test Report, Medicine declaration, IEC No. PAN, Authority Letter, DDA DOCUMENTS REQUIRED FOR BANGLADESH SHIPMENT. 1) EXPORT INVOICES - 10 COPIES 2) PACKING LIST - 10 COPIES 3) L/C - 2 SETS 4) PROFORMA INVOICE - 2 SETS 5) ARE-1 IN ORIGINAL &amp; DUPLICATE. IF NOT UNDER ARE-1, PURCHASE DETAILS OR MANUFACTURING CERTIFICATE. 6) NEGOTIATION BANK AD CODE LETTER WITH IFSC CODE, BANK ACCOUNT NUMBER &amp; NAME ON THE LETTER HEADS OF BANK. 7) IEC CODE WITH APPROVED BRANCH LIST. 8) CERTIFICATE OF ORIGIN. 9) SDF FORM IF VALUE EXCEED DOLLAR 25000/- 10) IF UNDER ADVANCE LICENSE (DECLARATION ALONG WITH CERTIFICATE OF DES PHOTOCOPY) 11) IN CASE OF DES SHIPMENT PLEASE GIVE US COPY OF LICENSE IN FULL AND DES DECLARATION GIVING FULL DETAILS OF IMPORTED/INDEGENOUS MATERIALS USED. 12) IF UNDER DEEC THE PHOTOCOPY OF DECLARATION IS REQUIRE. ALSO PLEASE NOTE THAT NOW PARKING SLIP IS BEING INTRODUCED AT PETRAPOLE, WHERE EVERY TRUCK DETAILS HAVE TO FILL UP. FOR THIS PLEASE ENSURE TRUCKS ARE HOLDING ALL VALID DOCUMENTS LIKE DRIVER LICENSE, VALID RC, POLLUTION CERTIFICATE ETC. ***


Related questions

Difference between simple and symmetrical dda line drawing algorithm?

"Simple DDA" does not require special skills for implementation.


Which line drawing algorithm is better dda or bresenhams?

Bresenhams' algorithm is better


Give 10 difference between dda and bresenham algorithm?

DDA algorithm involves floating-point operations, while Bresenham algorithm uses only integer operations. DDA algorithm calculates the exact position of each pixel, while Bresenham algorithm determines the closest pixel to the ideal line path. DDA algorithm can suffer from precision issues due to floating-point calculations, while Bresenham algorithm is more accurate and efficient. DDA algorithm is simpler to implement but slower than Bresenham algorithm. DDA algorithm is susceptible to rounding errors, while Bresenham algorithm is not. DDA algorithm can produce jagged lines due to rounding errors, while Bresenham algorithm generates smoother lines. DDA algorithm is suitable for both lines and circles, while Bresenham algorithm is primarily used for drawing lines. DDA algorithm can handle lines with any slope, while Bresenham algorithm is more efficient for lines with slopes close to 0 or 1. DDA algorithm involves multiplication and division operations, while Bresenham algorithm uses addition and subtraction operations. DDA algorithm is a general line drawing algorithm, while Bresenham algorithm is specialized for line drawing and rasterization.


Which modifications are necessary to generate dda dotted line code from dda algorithm?

What is the advantage of bresenham algorithm over dda algorithm?Read more: What_is_the_advantage_of_bresenham_algorithm_over_dda_algorithm


What are the differences between Bresenham's line algorithm and Bresenham's circle algorithm?

These two algorithms are almost completely different. The only real similarity is that they are each designed to use only integer addition/subtraction and multiplication, avoiding expensive division and floating point operations.


What are the advantages of bresenhams's line drawing algorithm over the cartesian slope ana ddadigitial defrantial analyser?

DDA uses float numbers and uses operators such as division and multiplication in its calculation. Bresgenham's algorithm uses ints and only uses addition and subtraction. Due to the use of only addition subtraction and bit shifting (multiplication and division use more resources and processor power) bresenhams algorithm is faster than DDA in producing the line. Im not sure, though if i remember right, they still produce the same line in the end. One note concerning efficiency: Fixed point DDA algorithms are generally superior to Bresenhams algorithm on modern computers. The reason is that Bresenhams algorithm uses a conditional branch in the loop, and this results in frequent branch mispredictions in the CPU. Fixed point DDA also has fewer instructions in the loop body (one bit shift, one increment and one addition to be exact. In addition to the loop instructions and the actual plotting). As CPU pipelines become deeper, mispredictions penalties will become more severe. Since DDA uses rounding off of the pixel position obtained by multiplication or division, causes an accumulation of error in the proceeding pixels whereas in Bresenhams line algorithm the new pixel is calculated with a small unit change in one direction and checking of nearest pixel with the decision variable satisfying the line equation.


What is simple dda?

DDA stands for Digital Differential Analyzer. With that in mind, simple DDA just means that it is simplified.


Differences between digital differential analyzer and bresenham algorithm?

The Digital Differential Analyzer (DDA) algorithm calculates the pixels along a line by dividing the distance between the two endpoints, while Bresenham's algorithm uses integer arithmetic to plot the pixels more efficiently. The DDA algorithm can be slower due to floating-point calculations, while Bresenham's algorithm is typically faster and more accurate for drawing lines on a raster display.


DDA line algorithm to be executed in C?

C Programming Coding For DDA Algorithmvoid 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;putpixel(round(x),round(y),2)for(k=0;k


Advantages of DDA line drawing algorithm?

DDA Line Drawing AlgorithmStep 1:[Determine The Dx & Dy]Dx=Xb-XaDy=Yb-YaStep 2:[Determine Slope is Gentle or Sharp]If |Dx|>|Dy| thenGentle SlopeM=Dy/DxSet The Starting PointIf Dx>0 ThenC=CELING(Xb)D=Yb+M*(C-Xb)F=FLOOR(Xa)R=FLOOR(D+0.5)H=R-D+MIF M>0 ThenPositive Gentle SlopeM1=M-1Now Step Through The ColumnsWHILE Cabs(dy)) steps=abs(dx);else steps=abs(dy);xincrement=dx/(float)steps;yincrement=dy/(float)steps;putpixel(round(x),round(y),2)for(k=0;k


What is the limitation of DDA line generation algorithm?

1.It drift away from the actual line path because of rounding off float values to integer2.It causes jaggies or stair-step effect----------------------------------------------------------------------------------------------------------------Disadvantage:The accumulation of round of error is successive addition of the floating point increments is used to find the pixel position but it take lot of time to compute the pixel position. ----------------------------------------------------------------------------------------------------------------More Informationhttp://knol.google.com/k/thiyagaraaj-m/dda-line-algorithm/1lfp8o9xxpx13/78# http://i.thiyagaraaj.com/articles/articles/dda-line-algorithm----------------------------------------------------------------------------------------------------------------the standard version of dda given as in one of its steps asif(abs(dx)>abs(dy)) steps=abs(dx);else steps=abs(dy);this part just supports the positive slop with starting point on left side. Take an example of any other end points as {(8,3) to (2,2) or (4,5) to ( 8,2) or (8,3) to (5,5) } where the slop needs to be negative( for the last two cases) only.can anyone correct me by suggesting the accurate version of DDA? Or is this the actual DDA??.


Advantages of DDA algorithms?

Advantages & disadvantages of DDA:-Faster than the direct use of the line equation and it does not do any floating point multiplication.Floating point Addition is still needed.Precision loss because of rounding off.Pixels drift farther apart if line is relatively larger.