Skip to content

Commit 141c7b7

Browse files
authored
Merge branch 'gz-math7' into jrivero/python_bindings_versioned
2 parents 988f6f6 + 3f63e1f commit 141c7b7

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

tutorials/cppgetstarted.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Previous Tutorial: \ref install
77
This tutorial describes how to get started using Gazebo Math with C++.
88

99
We will run through an example that determines the distance between two
10-
points in 3D space. Start by creating a bare-bones main file using the
10+
points in 3D space. Start by creating a bare-bones `main.cpp` file using the
1111
editor of your choice.
1212

1313
```{.cpp}
@@ -67,6 +67,19 @@ int main()
6767
}
6868
```
6969

70+
To compile this code on UNIX with pkg-config, use the following command:
71+
72+
```{.bash}
73+
c++ $(pkg-config --cflags gz-math7) main.cpp -o main
74+
~~~
75+
76+
The program can then be run as:
77+
78+
```{.bash}
79+
$ ./main
80+
Distance from 1 3 5 to 2 4 6 is 1.73205
81+
~~~
82+
7083
## Bonus: Vector2 Example
7184
7285
The following is an example program that uses Vector2 to perform some simple

tutorials/pythongetstarted.md

+6
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,9 @@ def main():
7373
if __name__ == "__main__":
7474
main()
7575
```
76+
77+
Running this program should result in the following output:
78+
79+
```{.bash}
80+
Distance from 1 3 5 to 2 4 6 is 1.7320508075688772
81+
```

0 commit comments

Comments
 (0)