Autoware.Auto
common_3d.hpp
Go to the documentation of this file.
1 // Copyright 2017-2019 the Autoware Foundation
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //    http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 //
15 // Co-developed by Tier IV, Inc. and Apex.AI, Inc.
18 
19 #ifndef GEOMETRY__COMMON_3D_HPP_
20 #define GEOMETRY__COMMON_3D_HPP_
21 
22 #include <geometry/common_2d.hpp>
23 
24 namespace autoware
25 {
26 namespace common
27 {
28 namespace geometry
29 {
30 
36 template<typename T1, typename T2>
37 inline auto dot_3d(const T1 & pt, const T2 & q)
38 {
39  using point_adapter::x_;
40  using point_adapter::y_;
41  using point_adapter::z_;
42  return (x_(pt) * x_(q)) + (y_(pt) * y_(q) + z_(pt) * z_(q));
43 }
44 
45 } // namespace geometry
46 } // namespace common
47 } // namespace autoware
48 
49 #endif // GEOMETRY__COMMON_3D_HPP_
This file includes common functionality for 2D geometry, such as dot products.
auto z_(const PointT &pt)
Gets the z value for a point.
Definition: common_2d.hpp:65
auto dot_3d(const T1 &pt, const T2 &q)
compute p * q = p1 * q1 + p2 * q2 + p3 * 13
Definition: common_3d.hpp:37
auto x_(const PointT &pt)
Gets the x value for a point.
Definition: common_2d.hpp:47
auto y_(const PointT &pt)
Gets the y value for a point.
Definition: common_2d.hpp:56
This file defines the lanelet2_map_provider_node class.
Definition: quick_sort.hpp:24