-
Notifications
You must be signed in to change notification settings - Fork 0
/
Utility.cpp
52 lines (41 loc) · 2.03 KB
/
Utility.cpp
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include <cstdlib>
#include <iostream>
#include <math.h>
#define _USE_MATH_DEFINES
#include "GeometryArms.h"
using namespace std;
void menu(GeometryArms g) {
cout << " ##### ##### ###### \n";
cout << " # # # # # # #### ##### #### ##### # #### #### \n";
cout << " # # # # # # # # # # # # # # # \n";
cout << " ##### # #### ##### ###### # # ##### # # # # # #### \n";
cout << " # # # # # # # # # # # # # # # \n";
cout << " # # # # # # # # # # # # # # # # # # \n";
cout << " ##### ##### # # #### ##### #### # # #### #### \n\n";
cout << "+------------ Menu ------------+ +-------------------------+\n"
<< "| 0: Exit | | L1: " << g.sGeoA.L1 << " \n"
<< "+------------------------------+ +-------------------------+\n"
<< "| 1: Arm Geometry | | L2: " << g.sGeoA.L2 << " \n"
<< "+------------------------------+ +-------------------------+\n"
<< "| 2: 3D Forward Kinematics |\n"
<< "+------------------------------+\n"
<< "| 3: 3D Inverse Kinematics |\n"
<< "+------------------------------+\n"
<< "| 4: 2D Forward Kinematics |\n"
<< "+------------------------------+\n"
<< "| 5: 2D Inverse Kinematics |\n"
<< "+------------------------------+\n";
cout << "\nSelect an option : ";
}
//============================================================================
void cls() {
cout << string(5, '\n');
}
//============================================================================
double DegreeToRadiant(double degree) {
return degree * (M_PI / 180.0);
}
//============================================================================
double RadiantToDegree(double radiant) {
return radiant * (180.0 / M_PI);
}