This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
The MIT License | |
Copyright (c) Jeff Hansen 2018 to present. | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION W |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<stdlib.h> | |
#include<string.h> | |
char ip_sym[15],stack[15]; | |
int ip_ptr=0,st_ptr=0,len,i; | |
char temp[2]; | |
char act[15]; | |
void check(); | |
void main() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<stdlib.h> | |
#include<string.h> | |
char prod [3][10]={"A->aBa","B->bB","B->@"}; | |
char first[3][10]={"a","b","@"}; | |
char follow[3][10]={"$","a","a"}; | |
char table[3][4][10]; | |
char input[10]; | |
int top=-1; | |
char stack[25]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<GL/glut.h> | |
#include<math.h> | |
float v[][3] = { {-1,-1,-1} ,{ -1,1,-1 } ,{ 1,1,-1 } ,{ 1,-1,-1 } ,{ -1,-1,1 } ,{ -1,1,1 } ,{ 1,1,1 } ,{ 1,-1,1 } }; // 8 vertices of the cube with origin as its centroid | |
int t[] = { 0,0,0 }; // degree of rotation along {x,y,z} | |
int ax = 2; // axis of rotation | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<GL/glut.h> | |
int xmax = 100, ymax = 100, xmin = 50, ymin = 50, x1 = 80, y1 = 120, x0 = 60, y0 = 20, left = 8, right = 2, bottom = 1, top = 4, x, y; | |
float m = (y1 - y0) / (x1 - x0); | |
void Init() | |
{ | |
gluOrtho2D(0, 400, 0, 400); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<GL/glut.h> | |
#include<math.h> | |
int le[500], re[500], flag=0 ,m; | |
void init() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* LAB 2: ROTATION OF TRIANGLE ABOUT A GIVEN POINT*/ | |
#include<stdio.h> | |
#include<GL/glut.h> | |
#include<math.h> | |
#define pi 3.1415 | |
float tri[4][4] = { { 150.0,250.0,350.0 } ,{ 250.0,350.0,250.0 },{ 1.0,1.0,1.0 },{ 1.0,1.0,1.0 } }; | |
float rotate[4][4], result[4][4], angle=90, h=150,k=250; | |
float theta = pi / 180.0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdlib.h> | |
#include<stdio.h> | |
#include<math.h> | |
#include<GL/glut.h> | |
int xstart, ystart, xend, yend; | |
void init() | |
{ |