Pages

This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Monday, 14 May 2012

source code procedure djikstra matrik c++ infinity

#include<iostream.h> #include<stdlib.h> #define MAX 20 #define INFINITY 9999 class dijkstra { private: int n; int graph[MAX][MAX]; int colour[MAX]; int start; int distance[MAX]; int predecessor[MAX]; enum {green,yellow,red}; public: void read_graph(); void initialize(); int select_min_distance_lable(); void update(int); void output(); void function(); }; void dijkstra::read_graph() { cout<<"Enter the no. of nodes in the graph ::"; cin>>n; cout<<"Enter the adjacency matrix for the graph ::\n"; int i,j; for(i=1;i<=n;i++) for(j=1;j<=n;j++) cin>>graph[i][j]; for(i=1;i<=n;i++) colour[i]=green; cout<<"Enter...

Friday, 4 May 2012

membuat lingkaran

 /* Praktikum 05 * Membuat objek lingkaran sederhana */ #include <iostream> #include <windows.h>  #include <stdio.h>  #include <stdlib.h>  #include <string.h>  #include <stdarg.h>  #include <glut.h>  #include<math.h> using namespace std; typedef unsigned char uchar; // number of line segments static int num_lines = 20; // callback prototypes void disp(void); void keyb(uchar k, int x, int y); void reshape(int x, int y); // main int main(int...

Tuesday, 1 May 2012

Membuat objek garis dengan DDA dan Bresenham

* Menggunakan Visual studio 2008 #include <windows.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdarg.h> #include <glut.h> #include <math.h> void display(void) { //set display-window background color to white glClearColor(1.0,1.0,1.0,0.0); //set projection parameters glMatrixMode(GL_PROJECTION); gluOrtho2D(0.0,300.0,0.0,300.0); } void setPixel (GLint xCoordinate, GLint yCoordinate) { glBegin (GL_POINTS); glVertex2i (xCoordinate, yCoordinate); glEnd(); glFlush(); } //Procedure...