Skip to content

Instantly share code, notes, and snippets.

View DieTime's full-sized avatar
Working from home

Denis Glazkov DieTime

Working from home
View GitHub Profile
float cx = (x + x2 + x3) / 3;
float cy = (y + y2 + y3) / 3;
float l1 = std::sqrt((x - cx) * (x - cx) + (y - cy) * (y - cy));
float l2 = std::sqrt((x2 - cx) * (x2 - cx) + (y2 - cy) * (y2 - cy));
float l3 = std::sqrt((x3 - cx) * (x3 - cx) + (y2 - cy) * (y2 - cy));
float dx = 2 * (x - cx) / l1 * (width / (float)glutGet(GLUT_WINDOW_WIDTH));
float dy = 2 * (y - cy) / l1 * (width / (float)glutGet(GLUT_WINDOW_HEIGHT));
float dx2 = 2 * (x2 - cx) / l2 * (width / (float)glutGet(GLUT_WINDOW_WIDTH));
float dy2 = 2 * (y2 - cy) / l2 * (width / (float)glutGet(GLUT_WINDOW_HEIGHT));
float dx3 = 2 * (x3 - cx) / l3 * (width / (float)glutGet(GLUT_WINDOW_WIDTH));
@DieTime
DieTime / lesson2.ipynb
Created January 8, 2020 18:43
Урок СИ #2
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@DieTime
DieTime / lesson1.ipynb
Created January 8, 2020 18:42
Урок СИ #1
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
#include <ctype.h>
// Функция сравнения строк
int mystrcmp(char* s1, char* s2) {
int i = 0;
// пока одна из строк не закончится сравниваем символы
while (s1[i] != '\0' && s2[i] != '\0')
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
// Подсчет размера строки
int strlen(char* a) {
int i = 0;
while (a[i] != '\0') {
i++;
}
@DieTime
DieTime / RK.c
Last active December 15, 2019 15:20
#pragma warning(disable:4996)
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
#include <string.h>
struct Student {
char surname[32];
char group[32];
@DieTime
DieTime / Popular sorting.cpp
Last active May 9, 2019 08:52
Types of sorting: Shell, Inserts and Bubble