-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path3.1.cpp
More file actions
36 lines (24 loc) · 900 Bytes
/
3.1.cpp
File metadata and controls
36 lines (24 loc) · 900 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Part2.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы.
//
#include <iostream>
#include <cxcore.h>
#include <_highgui.h>
int main()
{
// упражнение 3.1.a
double example = -1.125;
int ExampleFromRound = cvRound(example);
int ExampleFromCeiling = cvCeil(example);
int ExampleFromFloor = cvFloor(example);
// упражнение 3.1.б
float value0 = rand();
float value1 = rand();
// упражнение 3.1.c
CvPoint2D32f* CvPointFloat = new CvPoint2D32f();
CvPointFloat->x = value0;
CvPointFloat->y = value1;
CvPoint CvPointInt = cvPointFrom32f(CvPointFloat[0]);
CvPoint2D32f CvPointFloatBack = cvPointTo32f(CvPointInt);
// удаление переменных
delete CvPointFloat;
}