Skip to content

Commit 0b72711

Browse files
authored
Merge pull request #22 from ichiro-its/21-wrong-result-in-point2-direction
21 wrong result in point2 direction
2 parents 4949f0c + 99bf979 commit 0b72711

File tree

17 files changed

+85
-84
lines changed

17 files changed

+85
-84
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,5 @@ endif()
5555

5656
ament_export_include_directories("include")
5757
ament_export_libraries(${PROJECT_NAME})
58+
5859
ament_package()

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021 Ichiro ITS
3+
Copyright (c) 2021 ICHIRO ITS
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ Keisan is a [ROS 2](https://docs.ros.org/en/foxy/index.html) package that provid
1010

1111
## License
1212

13-
This project is maintained by [ICHIRO ITS](https://github.com/ichiro-its) and licensed under [the MIT License](./LICENSE).
13+
This project is maintained by [ICHIRO ITS](https://github.com/ichiro-its) and licensed under the [MIT License](./LICENSE).

include/keisan/angle.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021 Ichiro ITS
1+
// Copyright (c) 2021 ICHIRO ITS
22
//
33
// Permission is hereby granted, free of charge, to any person obtaining a copy
44
// of this software and associated documentation files (the "Software"), to deal

include/keisan/keisan.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021 Ichiro ITS
1+
// Copyright (c) 2021 ICHIRO ITS
22
//
33
// Permission is hereby granted, free of charge, to any person obtaining a copy
44
// of this software and associated documentation files (the "Software"), to deal

include/keisan/number.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021 Ichiro ITS
1+
// Copyright (c) 2021 ICHIRO ITS
22
//
33
// Permission is hereby granted, free of charge, to any person obtaining a copy
44
// of this software and associated documentation files (the "Software"), to deal

include/keisan/point_2.hpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021 Ichiro ITS
1+
// Copyright (c) 2021 ICHIRO ITS
22
//
33
// Permission is hereby granted, free of charge, to any person obtaining a copy
44
// of this software and associated documentation files (the "Software"), to deal
@@ -30,32 +30,32 @@ struct Point2
3030
Point2(double x, double y);
3131
Point2(const Point2 & point);
3232

33-
Point2 & operator=(Point2 & point);
34-
Point2 & operator+=(Point2 & point);
35-
Point2 & operator-=(Point2 & point);
33+
Point2 & operator=(const Point2 & point);
34+
Point2 & operator+=(const Point2 & point);
35+
Point2 & operator-=(const Point2 & point);
3636

3737
Point2 & operator+=(double value);
3838
Point2 & operator-=(double value);
3939
Point2 & operator*=(double value);
4040
Point2 & operator/=(double value);
4141

42-
Point2 operator+(Point2 & point);
43-
Point2 operator-(Point2 & point);
42+
Point2 operator+(const Point2 & point) const;
43+
Point2 operator-(const Point2 & point) const;
4444

45-
Point2 operator+(double value);
46-
Point2 operator-(double value);
47-
Point2 operator*(double value);
48-
Point2 operator/(double value);
45+
Point2 operator+(double value) const;
46+
Point2 operator-(double value) const;
47+
Point2 operator*(double value) const;
48+
Point2 operator/(double value) const;
4949

50-
static double distance_between(Point2 & point_a, Point2 & point_b);
51-
static double angle_between(Point2 & point_a, Point2 & point_b);
52-
static double dot_product(Point2 & point_a, Point2 & point_b);
53-
static double cross_product(Point2 & point_a, Point2 & point_b);
50+
static double distance_between(const Point2 & point_a, const Point2 & point_b);
51+
static double angle_between(const Point2 & point_a, const Point2 & point_b);
52+
static double dot_product(const Point2 & point_a, const Point2 & point_b);
53+
static double cross_product(const Point2 & point_a, const Point2 & point_b);
5454

55-
double magnitude();
56-
double direction();
55+
double magnitude() const;
56+
double direction() const;
5757

58-
Point2 normalize();
58+
Point2 normalize() const;
5959

6060
double x;
6161
double y;

include/keisan/point_3.hpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021 Ichiro ITS
1+
// Copyright (c) 2021 ICHIRO ITS
22
//
33
// Permission is hereby granted, free of charge, to any person obtaining a copy
44
// of this software and associated documentation files (the "Software"), to deal
@@ -30,32 +30,32 @@ struct Point3
3030
Point3(double x, double y, double z);
3131
Point3(const Point3 & point);
3232

33-
Point3 & operator=(Point3 & point);
34-
Point3 & operator+=(Point3 & point);
35-
Point3 & operator-=(Point3 & point);
33+
Point3 & operator=(const Point3 & point);
34+
Point3 & operator+=(const Point3 & point);
35+
Point3 & operator-=(const Point3 & point);
3636

3737
Point3 & operator+=(double value);
3838
Point3 & operator-=(double value);
3939
Point3 & operator*=(double value);
4040
Point3 & operator/=(double value);
4141

42-
Point3 operator+(Point3 & point);
43-
Point3 operator-(Point3 & point);
42+
Point3 operator+(const Point3 & point) const;
43+
Point3 operator-(const Point3 & point) const;
4444

45-
Point3 operator+(double value);
46-
Point3 operator-(double value);
47-
Point3 operator*(double value);
48-
Point3 operator/(double value);
45+
Point3 operator+(double value) const;
46+
Point3 operator-(double value) const;
47+
Point3 operator*(double value) const;
48+
Point3 operator/(double value) const;
4949

50-
static double distance_between(Point3 & point_a, Point3 & point_b);
51-
static double angle_between(Point3 & point_a, Point3 & point_b);
52-
static double dot_product(Point3 & point_a, Point3 & point_b);
53-
static double cross_product(Point3 & point_a, Point3 & point_b);
50+
static double distance_between(const Point3 & point_a, const Point3 & point_b);
51+
static double angle_between(const Point3 & point_a, const Point3 & point_b);
52+
static double dot_product(const Point3 & point_a, const Point3 & point_b);
53+
static double cross_product(const Point3 & point_a, const Point3 & point_b);
5454

55-
double magnitude();
56-
double direction();
55+
double magnitude() const;
56+
double direction() const;
5757

58-
Point3 normalize();
58+
Point3 normalize() const;
5959

6060
double x;
6161
double y;

package.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
33
<package format="3">
44
<name>keisan</name>
5-
<version>0.1.0</version>
6-
<description>A Math equations and algorithms package</description>
5+
<version>0.2.0</version>
6+
<description>Math equations and algorithms library</description>
77
<maintainer email="alfi.maulana.f@gmail.com">Alfi Maulana</maintainer>
88
<license>MIT License</license>
99
<buildtool_depend>ament_cmake</buildtool_depend>

src/angle.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021 Ichiro ITS
1+
// Copyright (c) 2021 ICHIRO ITS
22
//
33
// Permission is hereby granted, free of charge, to any person obtaining a copy
44
// of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)