Line | |
---|
1 | #include <Eigen/Dense>
|
---|
2 | #include <iostream>
|
---|
3 |
|
---|
4 | using namespace Eigen;
|
---|
5 | using namespace std;
|
---|
6 |
|
---|
7 | int main(int, char**)
|
---|
8 | {
|
---|
9 | cout.precision(3);
|
---|
10 | Vector3f boxMin(Vector3f::Zero()), boxMax(Vector3f::Ones());
|
---|
11 | Vector3f p0 = Vector3f::Random(), p1 = Vector3f::Random().cwiseAbs();
|
---|
12 | // let's check if p0 and p1 are inside the axis aligned box defined by the corners boxMin,boxMax:
|
---|
13 | cout << "Is (" << p0.transpose() << ") inside the box: "
|
---|
14 | << ((boxMin.array()<p0.array()).all() && (boxMax.array()>p0.array()).all()) << endl;
|
---|
15 | cout << "Is (" << p1.transpose() << ") inside the box: "
|
---|
16 | << ((boxMin.array()<p1.array()).all() && (boxMax.array()>p1.array()).all()) << endl;
|
---|
17 |
|
---|
18 | return 0;
|
---|
19 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.