-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.cpp
More file actions
21 lines (16 loc) · 718 Bytes
/
example.cpp
File metadata and controls
21 lines (16 loc) · 718 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <iostream>
#include "ik2j.h"
int main() {
constexpr double close_len = 5; // 5 inches
constexpr double far_len = 6; // 6 inches
auto point = IK::CylPoint::from_cartesian(10, 0, 1);
auto solution = IK::solve(point, close_len, far_len);
{ // Log everything out
auto todeg = [](double r) {return r / M_PI * 180.0;};
std::cout << "Is Valid: " << (solution.valid? "true" : "false") << std::endl;
std::cout << "Close Angle Deg: " << todeg(solution.near_angle) << std::endl;
std::cout << "Far Angle Deg: " << todeg(solution.far_angle) << std::endl;
std::cout << "Table Angle Deg: " << todeg(solution.table_angle) << std::endl;
}
return 0;
}