Tuesday, October 9, 2018

C program for Koch curve Computer graphics

#include<graphics.h>
#include<conio.h>
#include<math.h>

void koch(int x1, int y1, int x2, int y2, int it)
{
 float angle = 60*M_PI/180;
 int x3 = (2*x1+x2)/3;
 int y3 = (2*y1+y2)/3;

 int x4 = (x1+2*x2)/3;
 int y4 = (y1+2*y2)/3;

 int x = x3 + (x4-x3)*cos(angle)+(y4-y3)*sin(angle);
 int y = y3 - (x4-x3)*sin(angle)+(y4-y3)*cos(angle);

 if(it > 0)
 {
  koch(x1, y1, x3, y3, it-1);
  koch(x3, y3, x, y, it-1);
  koch(x, y, x4, y4, it-1);
  koch(x4, y4, x2, y2, it-1);
 }
 else
 {

  line(x1, y1, x3, y3);
  line(x3, y3, x, y);
  line(x, y, x4, y4);
  line(x4, y4, x2, y2);
 }
}

int main(void)
{
 int gd = DETECT, gm,i,n, x1 = 100, y1 = 100, x2 = 400, y2 = 400;
 initgraph(&gd,&gm,"");
 printf("Enter number of interations");
 scanf("%d",&n);
 for(i=0;i<n;i++)
 {
 cleardevice();
 koch(x1, y1, x2, y2, i);
 getch();
 }
 return 0;
}

C Program for Bezier Curve (computer graphics)

#include <stdio.h>
#include <graphics.h>
#include <conio.h>
int maxx,maxy;
float xxx[4][2];

void line1(float x2,float y2)
{
line(xxx[0][0],xxx[0][1],x2,y2);
delay(10);
xxx[0][0]=x2;
xxx[0][1]=y2;
}

void bezier(float xb,float yb,float xc,float yc,float xd,float yd,int n)
{
float xab,yab,xbc,ybc,xcd,ycd;
float xabc,yabc,xbcd,ybcd;
float xabcd,yabcd;
if (n==0)
{
line1(xb,yb);
line1(xc,yc);
line1(xd,yd);
}
else
{
xab = (xxx[0][0]+xb)/2;
yab = (xxx[0][1]+yb)/2;
xbc = (xb+xc)/2;
ybc = (yb+yc)/2;
xcd = (xc+xd)/2;
ycd = (yc+yd)/2;
xabc = (xab+xbc)/2;
yabc = (yab+ybc)/2;
xbcd = (xbc+xcd)/2;
ybcd = (ybc+ycd)/2;
xabcd = (xabc+xbcd)/2;
yabcd = (yabc+ybcd)/2;
n=n-1;
bezier(xab,yab,xabc,yabc,xabcd,yabcd,n);
bezier(xbcd,ybcd,xcd,ycd,xd,yd,n);
}
}
main()
{
int gd=DETECT,gm,i;
float temp1,temp2;
initgraph(&gd,&gm,"");
for(i=0;i<4;i++)
{
printf("Enter (x,y) coordinates of point%d : ",i+1);
scanf("%f%f",&temp1,&temp2);
putpixel(temp1,temp2,15);
xxx[i][0] = temp1;
xxx[i][1] = temp2;
}
bezier(xxx[1][0],xxx[1][1],xxx[2][0],xxx[2][1],xxx[3][0],xxx[3][1],8);
getch();
closegraph();
}

Thursday, March 15, 2018

Web Page Designing with HTML Experiment No. 1



Create web Page using structure tags to display sample message.

<!doctype html>
<html>
<head>
<title>First Example</title>
</head>
<body>
Welcome to HTML World
</body>
</html>

Thursday, October 19, 2017

What is steganography? How to perform steganography without using any software

What is Steganography : 

It is the art of hiding secret message inside ordinary message (which has no meaning). Steganography is alternate to encryption. Steganography is the useful technique to achieve computer security or information security.

In encryption the message to be kept secret (which is in plaintext/readable format) is applied to encryption algorithm and as a result of encryption algorithm the plaintext message get converted into ciphertext (ciphertext is the text which is not readable and understandable) and transmitted to destination.

If there is a person who capture the transmission media and who is able to sniff the messages in transit then the secret message in ciphertext form may attract to that third person. Ciphertext are point of attractions since it don’t have meaning, so the ultimate aim of attacker is to understand the ciphertext.