Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void DisplayMelc() {
- double pi = 4 * atan(1.0);
- double a = 0.3;
- double b = 0.2;
- double tmin = -1 * pi,tmax=pi;
- double ratia = 0.005;
- double proportia = 0.80;
- double x, y;
- glColor3f(1, 0.1, 0.1); // rosu
- glBegin(GL_LINE_STRIP);
- for (double t = tmin + ratia; t < tmax; t+= ratia) {
- x = 2.0 * (a * cos(t) + b)*cos(t);
- y = 2.0 * (a * cos(t) + b) * sin(t);
- glVertex2f(x*proportia, y*proportia);
- }
- glEnd();
- }
- void DisplayCicloida() {
- double a = 0.1;
- double b = 0.2;
- double tmin = -9.5, tmax = 9.5;
- double ratia = 0.005;
- double proportia=0.9;
- double x, y;
- glColor3f(1, 0.1, 0.1); // rosu
- glBegin(GL_LINE_STRIP);
- for (double t = tmin ; t < tmax; t += ratia) {
- x = a * t - b * sin(t);
- y = a-b*cos(t);
- glVertex2f(x , y );
- }
- glEnd();
- }
- void DisplayHipocicloida() {
- double pi = 4 * atan(1.0);
- double R = 0.1;
- double r = 0.3;
- double tmin = 0, tmax = 2 * pi;
- double ratia = 0.005;
- double x, y;
- glColor3f(1, 0.1, 0.1); // rosu
- glBegin(GL_LINE_STRIP);
- for (double t = tmin; t < tmax; t += ratia) {
- x = (R-r)*cos(r/R*t)-r*cos(t-r/R*t);
- y = (R - r) *sin(r / R * t) - r * sin(t - r / R * t);
- glVertex2f(x , y);
- }
- glEnd();
- }
- void DisplaySpiralaLogaritmica() {
- double ratia = 0.05;
- double a = 0.02;
- glColor3f(1, 0.1, 0.1); // rosu
- glBegin(GL_LINE_STRIP);
- for (double t = 0 + ratia; t <=3; t += ratia) {
- double r=a*exp(1+t);
- double x = r * cos(t);
- double y = r * sin(t);
- glVertex2f(x ,y );
- }
- glEnd();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement