
LINE CLIPPING USING COHEN SUTHERLAND
ALGORITHM
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#define FALSE 0
#define TRUE 1
#define LEFTEDGE 0x1
#define RIGHTEDGE 0x2
#define TOPEDGE 0x8
#define BOTTOMEDGE 0x4
#define INSIDE(a) (!a)
#define REJECT(a,b) (a&b)
#define ACCEPT(a,b) (!(a|b))
unsigned char encode(int x,int y,int minx,int
maxx,int miny,int maxy)
{
...