Skip to content

Commit bf1c32a

Browse files
committedFeb 8, 2020
Added building samples on CI
1 parent 02e8c88 commit bf1c32a

File tree

2 files changed

+30
-7
lines changed

2 files changed

+30
-7
lines changed
 

‎.circleci/config.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,5 @@ workflows:
4141
version: 2
4242
build_and_test:
4343
jobs:
44-
- gtest:
45-
filters:
46-
branches:
47-
only:
48-
- master
49-
- develop
50-
- tests
44+
- gtest
45+
- samples

‎samples/Samples.cpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#include <iostream>
2+
#include <vector>
3+
4+
#include "SphericalUtil.hpp"
5+
6+
7+
int main() {
8+
LatLng up = { 90.0, 0.0 };
9+
LatLng down = {-90.0, 0.0 };
10+
LatLng front = { 0.0, 0.0 };
11+
LatLng right = { 0.0, 90.0 };
12+
13+
auto angle = SphericalUtil::computeAngleBetween(up, right);
14+
std::cout << "The angle between up and right is " << rad2deg(angle) << " degrees" << std::endl;
15+
16+
auto distance = SphericalUtil::computeDistanceBetween(up, down);
17+
std::cout << "The distance between up and down is " << distance << " meters" << std::endl;
18+
19+
std::vector<LatLng> points = { front, up, right };
20+
21+
auto length = SphericalUtil::computeLength(points);
22+
std::cout << "The length between front, up and right is " << length << " meters" << std::endl;
23+
24+
auto area = SphericalUtil::computeArea(points);
25+
std::cout << "The area between front, up and right is " << area << " square meters" << std::endl;
26+
27+
return 0;
28+
}

0 commit comments

Comments
 (0)