Skip to content

Commit 001baa8

Browse files
authored
Merge pull request #789 from danieldouglas92/fix_typo
Fix a typo
2 parents 273c38f + 881129c commit 001baa8

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

include/world_builder/objects/bezier_curve.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,17 @@ namespace WorldBuilder
4141
* @brief Construct a new Bezier Curve object
4242
*
4343
* @param p
44-
* @param angle_constrains
44+
* @param angle_constraints
4545
*/
4646
BezierCurve() = default;
4747

4848
/**
4949
* @brief Construct a new Bezier Curve object
5050
*
5151
* @param p
52-
* @param angle_constrains
52+
* @param angle_constraints
5353
*/
54-
BezierCurve(const std::vector<Point<2> > &p, const std::vector<double> &angle_constrains = {});
54+
BezierCurve(const std::vector<Point<2> > &p, const std::vector<double> &angle_constraints = {});
5555

5656
/**
5757
* @brief Finds the closest point on the curve. If the the closest point

source/world_builder/objects/bezier_curve.cc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,33 +32,33 @@ namespace WorldBuilder
3232
{
3333
namespace Objects
3434
{
35-
BezierCurve::BezierCurve(const std::vector<Point<2> > &p, const std::vector<double> &angle_constrains_input)
35+
BezierCurve::BezierCurve(const std::vector<Point<2> > &p, const std::vector<double> &angle_constraints_input)
3636
{
3737
points = p;
3838
const size_t n_points = p.size();
3939
control_points.resize(n_points-1, {{p[0],p[0]}});
4040
lengths.resize(n_points-1,NaN::DSNAN);
4141
angles.resize(n_points,NaN::DSNAN);
42-
std::vector<double> angle_constrains = angle_constrains_input;
43-
angle_constrains.resize(n_points,NaN::DQNAN);
42+
std::vector<double> angle_constraints = angle_constraints_input;
43+
angle_constraints.resize(n_points,NaN::DQNAN);
4444

4545
// if no angle is provided, compute the angle as the average angle between the previous and next point.
4646
// The first angle points at the second point and the last angle points at the second to last point.
4747
// The check points are set at a distance of 1/10th the line length from the point in the direction of the angle.
48-
if (std::isnan(angle_constrains[0]))
48+
if (std::isnan(angle_constraints[0]))
4949
{
5050
Point<2> P1P2 = points[1]-points[0];
5151
angles[0] = atan2(P1P2[1],P1P2[0]);
5252
}
5353
else
5454
{
55-
angles[0] = angle_constrains[0];
55+
angles[0] = angle_constraints[0];
5656
}
5757

5858
for (size_t p_i = 1; p_i < n_points-1; ++p_i)
5959
{
6060
// first determine the angle
61-
if (std::isnan(angle_constrains[p_i]))
61+
if (std::isnan(angle_constraints[p_i]))
6262
{
6363
// get the average angle
6464
const Point<2> P1P2 = points[p_i-1]-points[p_i];
@@ -72,19 +72,19 @@ namespace WorldBuilder
7272
}
7373
else
7474
{
75-
angles[p_i] = angle_constrains[p_i];
75+
angles[p_i] = angle_constraints[p_i];
7676
}
7777

7878
}
7979

80-
if (std::isnan(angle_constrains[n_points-1]))
80+
if (std::isnan(angle_constraints[n_points-1]))
8181
{
8282
Point<2> P1P2 = points[n_points-2]-points[n_points-1];
8383
angles[n_points-1] = atan2(P1P2[1],P1P2[0]);
8484
}
8585
else
8686
{
87-
angles[n_points-1] = angle_constrains[n_points-1];
87+
angles[n_points-1] = angle_constraints[n_points-1];
8888
}
8989

9090
if (points.size() > 2)

0 commit comments

Comments
 (0)