# Class CircleArc

- Defined in File Circle.hxx

## Inheritance Relationships

### Base Type

- `public G2lib::BaseCurve` (Class BaseCurve)

## Class Documentation

class G2lib::CircleArc : public G2lib::BaseCurve

  Class to manage a circle arc

  Public Functions

  inline CircleArc()

    Build an empty circle

  inline CircleArc(CircleArc const &s)

    Build a copy of an existing circle arc.

  inline explicit CircleArc(real_type x0, real_type y0, real_type theta0, real_type k, real_type L)

    Construct a circle arc with the standard parameters.

    Parameters

      - x0 – [in] starting position x-coordinate

      - y0 – [in] starting position y-coordinate

      - theta0 – [in] initial angle

      - k – [in] curvature

      - L – [in] length

  inline explicit CircleArc(LineSegment const &LS)

    Construct a circle arc from a line segment (degenerate circle).

  inline void copy(CircleArc const &c)

    Make a copy of an existing circle arc.

  explicit CircleArc(BaseCurve const &C)

    Build a circle arc from a generic curve (if possibile).

  inline CircleArc const &operator=(CircleArc const &s)

    Make a copy of an existing circle arc.

  inline void build(real_type x0, real_type y0, real_type theta0, real_type k, real_type L)

    Construct a circle arc with the standard parameters.

    Parameters

      - x0 – [in] starting position x-coordinate

      - y0 – [in] starting position y-coordinate

      - theta0 – [in] initial angle

      - k – [in] curvature

      - L – [in] length

  bool build_G1(real_type x0, real_type y0, real_type theta0, real_type x1, real_type y1)

    Build a circle by solving the hermite G1 problem.

    Parameters

      - x0 – [in] starting position x-coordinate

      - y0 – [in] starting position y-coordinate

      - theta0 – [in] initial angle

      - x1 – [in] final position x-coordinate

      - y1 – [in] final position y-coordinate

    Returns

      true if success

  bool build_3P(real_type x0, real_type y0, real_type x1, real_type y1, real_type x2, real_type y2)

    Build a circle passing by 3 points.

    Parameters

      - x0 – [in] starting point x-coordinate

      - y0 – [in] starting point y-coordinate

      - x1 – [in] intermediate point x-coordinate

      - y1 – [in] intermediate point y-coordinate

      - x2 – [in] final point x-coordinate

      - y2 – [in] final point y-coordinate

    Returns

      true if success

  bool bbTriangle(real_type &x0, real_type &y0, real_type &x1, real_type &y1, real_type &x2, real_type &y2) const

    Get the bounding box triangle (if angle variation less that pi/3).

    Parameters

      - x0 – [out] first triangle point x-coordinate

      - y0 – [out] first triangle point y-coordinate

      - x1 – [out] second triangle point x-coordinate

      - y1 – [out] second triangle point y-coordinate

      - x2 – [out] third triangle point x-coordinate

      - y2 – [out] third triangle point y-coordinate

    Returns

      true if success

  bool bbTriangle_ISO(real_type offs, real_type &x0, real_type &y0, real_type &x1, real_type &y1, real_type &x2, real_type &y2) const

    Get the bounding box triangle of the circle arc with offset (if angle variation less that \( \pi/3 \)).

    Parameters

      - offs – [in] offset

      - x0 – [out] first triangle point x-coordinate

      - y0 – [out] first triangle point y-coordinate

      - x1 – [out] second triangle point x-coordinate

      - y1 – [out] second triangle point y-coordinate

      - x2 – [out] third triangle point x-coordinate

      - y2 – [out] third triangle point y-coordinate

    Returns

      true if success

  inline bool bbTriangle_SAE(real_type offs, real_type &x0, real_type &y0, real_type &x1, real_type &y1, real_type &x2, real_type &y2) const

    Get the bounding box triangle of the circle arc with offset if angle variation less that \( \pi/3 \)).

    Parameters

      - offs – [in] offset

      - x0 – [out] first triangle point x-coordinate

      - y0 – [out] first triangle point y-coordinate

      - x1 – [out] second triangle point x-coordinate

      - y1 – [out] second triangle point y-coordinate

      - x2 – [out] third triangle point x-coordinate

      - y2 – [out] third triangle point y-coordinate

    Returns

      true if success

  inline bool bbTriangle(real_type *p0, real_type *p1, real_type *p2) const

    Get the bounding box triangle of the circle (if angle variation less that \( \pi/3 \)).

    Parameters

      - p0 – [out] first triangle point

      - p1 – [out] second triangle point

      - p2 – [out] third triangle point

    Returns

      true if success

  inline bool bbTriangle_ISO(real_type offs, real_type *p0, real_type *p1, real_type *p2) const

    Get the bounding box triangle of the circle arc with offset (if angle variation less that \( \pi/3 \)).

    Parameters

      - offs – [in] offset

      - p0 – [out] first triangle point

      - p1 – [out] second triangle point

      - p2 – [out] third triangle point

    Returns

      true if success

  inline bool bbTriangle_SAE(real_type offs, real_type *p0, real_type *p1, real_type *p2) const

    Get the bounding box triangle of the circle arc with offset (if angle variation less that \( \pi/3 \)).

    Parameters

      - offs – [in] offset

      - p0 – [out] first triangle point

      - p1 – [out] second triangle point

      - p2 – [out] third triangle point

    Returns

      true if success

  inline bool bbTriangle(Triangle2D &t, real_type ss0 = 0, real_type ss1 = 0, int_type icurve = 0) const

    Get the bounding box triangle list of the circle arc.

    Parameters

      - t – [out] the bounding triangle

      - ss0 – [in] `s0` stored in the triangle class

      - ss1 – [in] `s1` stored in the triangle class

      - icurve – [in] `id` stored in the triangle class

    Returns

      true if success

  inline bool bbTriangle_ISO(real_type offs, Triangle2D &t, real_type ss0 = 0, real_type ss1 = 0, int_type icurve = 0) const

    Get the bounding box triangle list of the circle arc with offset.

    Parameters

      - offs – [in] offset

      - t – [out] the bounding triangle

      - ss0 – [in] `s0` stored in the triangle class

      - ss1 – [in] `s1` stored in the triangle class

      - icurve – [in] `id` stored in the triangle class

    Returns

      true if success

  inline bool bbTriangle_SAE(real_type offs, Triangle2D &t, real_type ss0 = 0, real_type ss1 = 0, int_type icurve = 0) const

    Get the bounding box triangle list of the circle arc with offset.

    Parameters

      - offs – [in] offset

      - t – [out] the bounding triangle

      - ss0 – [in] `s0` stored in the triangle class

      - ss1 – [in] `s1` stored in the triangle class

      - icurve – [in] `id` stored in the triangle class

    Returns

      true if success

  virtual void bbTriangles(std::vector<Triangle2D> &tvec, real_type max_angle = Utils::m_pi / 18, real_type max_size = 1e100, int_type icurve = 0) const override

    Get the bounding box triangle list of the circle arc with offset.

    Parameters

      - tvec – [out] the bounding triangle list

      - max_angle – [in] maximum angle variation admitted for all splitted segment

      - max_size – [in] maximum size admitted for all splitted segment

      - icurve – [in] `id` stored in the triangles

  virtual void bbTriangles_ISO(real_type offs, std::vector<Triangle2D> &tvec, real_type max_angle = Utils::m_pi / 18, real_type max_size = 1e100, int_type icurve = 0) const override

    Get the bounding box triangle list of the circle arc with offset.

    Parameters

      - offs – [in] offset

      - tvec – [out] the bounding triangle list

      - max_angle – [in] maximum angle variation admitted for all splitted segment

      - max_size – [in] maximum size admitted for all splitted segment

      - icurve – [in] `id` stored in the triangles

  inline virtual void bbTriangles_SAE(real_type offs, std::vector<Triangle2D> &tvec, real_type max_angle = Utils::m_pi / 18, real_type max_size = 1e100, int_type icurve = 0) const override

    Get the bounding box triangle list of the circle arc with offset.

    Parameters

      - offs – [in] offset

      - tvec – [out] the bounding triangle list

      - max_angle – [in] maximum angle variation admitted for all splitted segment

      - max_size – [in] maximum size admitted for all splitted segment

      - icurve – [in] `id` stored in the triangles

  virtual void bbox(real_type &xmin, real_type &ymin, real_type &xmax, real_type &ymax) const override

    Compute the bounding box of the curve.

    Parameters

      - xmin – [out] left bottom

      - ymin – [out] left bottom

      - xmax – [out] right top

      - ymax – [out] right top

  virtual void bbox_ISO(real_type offs, real_type &xmin, real_type &ymin, real_type &xmax, real_type &ymax) const override

    Compute the bounding box of the curve with offset (ISO).

    Parameters

      - offs – [in] curve offset

      - xmin – [out] left bottom

      - ymin – [out] left bottom

      - xmax – [out] right top

      - ymax – [out] right top

  inline virtual real_type length() const override

    The length of the curve

  inline virtual real_type length_ISO(real_type offs) const override

    The length of the curve with offset (ISO)

  inline virtual real_type thetaBegin() const override

    Initial angle of the curve.

  inline virtual real_type kappaBegin() const override

    Initial curvature.

  inline virtual real_type kappaEnd() const override

    Final curvature.

  inline virtual real_type xBegin() const override

    Initial x-coordinate.

  inline virtual real_type yBegin() const override

    Initial y-coordinate.

  inline virtual real_type tx_Begin() const override

    Initial tangent x-coordinate.

  inline virtual real_type ty_Begin() const override

    Initial tangent y-coordinate.

  inline virtual real_type nx_Begin_ISO() const override

    Intial normal x-coordinate (ISO).

  inline virtual real_type ny_Begin_ISO() const override

    Intial normal y-coordinate (ISO).

  inline virtual real_type theta(real_type s) const override

    Angle at curvilinear coodinate `s`.

  inline virtual real_type theta_D(real_type) const override

    Angle derivative (curvature) at curvilinear coodinate `s`.

  inline virtual real_type theta_DD(real_type) const override

    Angle second derivative (devitive of curvature) at curvilinear coodinate `s`.

  inline virtual real_type theta_DDD(real_type) const override

    Angle third derivative at curvilinear coodinate `s`.

  inline virtual void evaluate(real_type s, real_type &th, real_type &kappa, real_type &x, real_type &y) const override

    Evaluate curve at curvilinear coordinate `s`.

    Parameters

      - s – [in] curvilinear coordinate

      - th – [out] angle

      - k – [out] curvature

      - x – [out] x-coordinate

      - y – [out] y-coordinate

  virtual real_type X(real_type s) const override

    x-coordinate at curvilinear coordinate `s`.

  virtual real_type Y(real_type s) const override

    y-coordinate at curvilinear coordinate `s`.

  virtual real_type X_D(real_type) const override

    x-coordinate derivative at curvilinear coordinate `s`.

  virtual real_type Y_D(real_type) const override

    y-coordinate derivative at curvilinear coordinate `s`.

  virtual real_type X_DD(real_type) const override

    x-coordinate second derivative at curvilinear coordinate `s`.

  virtual real_type Y_DD(real_type) const override

    y-coordinate second derivative at curvilinear coordinate `s`.

  virtual real_type X_DDD(real_type) const override

    x-coordinate third derivative at curvilinear coordinate `s`.

  virtual real_type Y_DDD(real_type) const override

    y-coordinate third derivative at curvilinear coordinate `s`.

  virtual void eval(real_type s, real_type &x, real_type &y) const override

    x and y-coordinate at curvilinear coordinate `s`.

  virtual void eval_D(real_type, real_type &x_D, real_type &y_D) const override

    x and y-coordinate derivative at curvilinear coordinate `s`.

  virtual void eval_DD(real_type, real_type &x_DD, real_type &y_DD) const override

    x and y-coordinate second derivative at curvilinear coordinate `s`.

  virtual void eval_DDD(real_type, real_type &x_DDD, real_type &y_DDD) const override

    x and y-coordinate third derivative at curvilinear coordinate `s`.

  inline virtual real_type tx(real_type s) const override

    Tangent x-coordinate at curvilinear coodinate `s`.

  inline virtual real_type tx_D(real_type s) const override

    Tangent derivative x-coordinate at curvilinear coodinate `s`.

  inline virtual real_type tx_DD(real_type s) const override

    Tangent second derivative x-coordinate at curvilinear coodinate `s`.

  inline virtual real_type tx_DDD(real_type s) const override

    Tangent third derivative x-coordinate at curvilinear coodinate `s`.

  inline virtual real_type ty(real_type s) const override

    Tangent y-coordinate at curvilinear coodinate `s`.

  inline virtual real_type ty_D(real_type s) const override

    Tangent derivative y-coordinate at curvilinear coodinate `s`.

  inline virtual real_type ty_DD(real_type s) const override

    Tangent second derivative y-coordinate at curvilinear coodinate `s`.

  inline virtual real_type ty_DDD(real_type s) const override

    Tangent third derivative y-coordinate at curvilinear coodinate `s`.

  virtual void tg(real_type s, real_type &tx, real_type &ty) const override

    Tangent at curvilinear coodinate `s`.

  virtual void tg_D(real_type s, real_type &tx_D, real_type &ty_D) const override

    Tangent derivative at curvilinear coodinate `s`.

  virtual void tg_DD(real_type s, real_type &tx_DD, real_type &ty_DD) const override

    Tangent second derivative at curvilinear coodinate `s`.

  virtual void tg_DDD(real_type s, real_type &tx_DDD, real_type &ty_DDD) const override

    Tangent third derivative at curvilinear coodinate `s`.

  inline virtual void translate(real_type tx, real_type ty) override

    translate curve by \( (t_x,t_y) \)

  virtual void rotate(real_type angle, real_type cx, real_type cy) override

    Rotate curve by angle \( theta \) centered at point \( (c_x,c_y)\).

    Parameters

      - angle – [in] angle \( theta \)

      - cx – [in] \( c_x\)

      - cy – [in] \( c_y\)

  virtual void reverse() override

    Reverse curve parameterization.

  inline virtual void changeOrigin(real_type newx0, real_type newy0) override

    Translate curve so that origin will be (`newx0`, `newy0`).

  virtual void scale(real_type s) override

    Scale curve by factor `sc`.

  virtual void trim(real_type s_begin, real_type s_end) override

    Cut curve at parametrix coordinate `s_begin` and `s_end`.

  virtual int_type closestPoint_ISO(real_type qx, real_type qy, real_type &x, real_type &y, real_type &s, real_type &t, real_type &dst) const override

    Given a point find closest point on the curve.

    Parameters

      - qx – x-coordinate of the point

      - qy – y-coordinate of the point

      - x – x-coordinate of the projected point on the curve

      - y – y-coordinate of the projected point on the curve

      - s – parameter on the curve of the projection

      - t – curvilinear coordinate of the point x,y (if orthogonal projection)

      - dst – distance point projected point

    Returns

      1 = point is projected orthogonal 0 = more than one projection (first returned) -1 = minimum point is not othogonal projection to curve

  virtual int_type closestPoint_ISO(real_type qx, real_type qy, real_type offs, real_type &x, real_type &y, real_type &s, real_type &t, real_type &dst) const override

    Given a point find closest point on the curve.

    Parameters

      - qx – x-coordinate of the point

      - qy – y-coordinate of the point

      - offs – offset of the curve

      - x – x-coordinate of the projected point on the curve

      - y – y-coordinate of the projected point on the curve

      - s – parameter on the curve of the projection

      - t – curvilinear coordinate of the point x,y (if orthogonal projection)

      - dst – distance point projected point

    Returns

      1 = point is projected orthogonal 0 = more than one projection (first returned) -1 = minimum point is not othogonal projection to curve

  inline virtual void info(ostream_type &stream) const override

    Pretty print of the curve data.

  bool collision(CircleArc const&) const

    Detect a collision with another circle arc.

  bool collision_ISO(real_type offs, CircleArc const &C, real_type offs_obj) const

    Detect a collision with another circle arc with offset.

    Parameters

      - offs – [in] offset of first circle arc

      - C – [in] second circle arc

      - offs_obj – [in] offset of second circle arc

  void intersect(CircleArc const &obj, IntersectList &ilist, bool swap_s_vals) const

    Intersect a circle arc with another circle arc.

    Parameters

      - obj – [in] second biarc

      - ilist – [out] list of the intersection (as parameter on the curves)

      - swap_s_vals – [in] if true store `(s2,s1)` instead of `(s1,s2)` for each intersection

  void intersect_ISO(real_type offs, CircleArc const &C, real_type offs_obj, IntersectList &ilist, bool swap_s_vals) const

    Intersect a circle arc with another circle arc with offset (ISO).

    Parameters

      - offs – [in] offset of first circle arc

      - C – [in] second circle arc

      - offs_obj – [in] offset of second circle arc

      - ilist – [out] list of the intersection (as parameter on the curves)

      - swap_s_vals – [in] if true store `(s2,s1)` instead of `(s1,s2)` for each intersection

  inline real_type sinTheta0() const

    Return \( \sin \theta_0 \) where \( \theta_0 \) is the initial tangent angle.

  inline real_type cosTheta0() const

    Return \( \cos \theta_0 \) where \( \theta_0 \) is the initial tangent angle.

  inline real_type curvature() const

    Return curvature of the circle arc.

  real_type lenTolerance(real_type tol) const

    Return the length of the arc that can approximated by a line segment.

  inline real_type delta_theta() const

    Return the tangent angle variation in the circle arc.

  inline real_type thetaTotalVariation() const

    Return the absolute value of the tangent angle variation in the circle arc.

  real_type thetaMinMax(real_type &thMin, real_type &thMax) const

    Minimum and maximum tangent angle.

    Parameters

      - thMin – [out] mimimum tangent angle

      - thMax – [out] maximum tangent angle

    Returns

      `thMax`-`thMin`

  inline real_type deltaTheta() const

    Minimum and maximum tangent angle.

    Parameters

      - thMin – [out] mimimum tangent angle

      - thMax – [out] maximum tangent angle

    Returns

      `thMax`-`thMin`

  void changeCurvilinearOrigin(real_type s0, real_type newL)

    Change the origin of the circle arc at \( s_0 \) and the length of the arc to \( L \).

    Parameters

      - s0 – [in] \( s_0 \)

      - newL – [in] \( L \)

  void center(real_type &cx, real_type &cy) const

    Get the center of the circle arc \( (c_x,c_y) \).

    Parameters

      - cx – [in] \( c_x \)

      - cy – [in] \( c_y \)

  inline real_type ray() const

    Get the ray of the circle arc.

  void paramNURBS(int_type &n_knots, int_type &n_pnts) const

    Get the parameters to build a NURBS for the circle ars.

    Parameters

      - n_knots – [out] number of knots for the NURBS

      - n_pnts – [out] number of point of the polygon of the NURBS

  void toNURBS(real_type *knots, real_type Poly[][3]) const

    Get the parameters to build a NURBS for the circle ars.

    Parameters

      - knots – [out] vector of the knots

      - Poly – [out] points of the polygon of the NURBS

  inline CurveType type() const

    The name of the curve type

  inline real_type length_SAE(real_type offs) const

    The length of the curve with offset (SAE)

  inline void bbox_SAE(real_type offs, real_type &xmin, real_type &ymin, real_type &xmax, real_type &ymax) const

    Compute the bounding box of the curve (SAE).

    Parameters

      - offs – [in] curve offset

      - xmin – [out] left bottom

      - ymin – [out] left bottom

      - xmax – [out] right top

      - ymax – [out] right top

  inline virtual real_type thetaEnd() const

    Final angle of the curve.

  inline virtual real_type xEnd() const

    Final x-coordinate.

  inline virtual real_type yEnd() const

    Final y-coordinate.

  inline virtual real_type xBegin_ISO(real_type offs) const

    Initial x-coordinate with offset (ISO standard).

  inline virtual real_type yBegin_ISO(real_type offs) const

    Initial y-coordinate with offset (ISO standard).

  inline virtual real_type xEnd_ISO(real_type offs) const

    Final x-coordinate with offset (ISO standard).

  inline virtual real_type yEnd_ISO(real_type offs) const

    Final y-coordinate with offset (ISO standard).

  inline real_type xBegin_SAE(real_type offs) const

    Initial x-coordinate with offset (SAE standard).

  inline real_type yBegin_SAE(real_type offs) const

    Initial y-coordinate with offset (SAE standard).

  inline real_type xEnd_SAE(real_type offs) const

    Final y-coordinate with offset (SAE standard).

  inline real_type yEnd_SAE(real_type offs) const

    Final y-coordinate with offset (ISO standard).

  inline virtual real_type tx_End() const

    Final tangent x-coordinate.

  inline virtual real_type ty_End() const

    Final tangent y-coordinate.

  inline virtual real_type nx_End_ISO() const

    Final normal x-coordinate (ISO).

  inline virtual real_type ny_End_ISO() const

    Final normal y-coordinate (ISO).

  inline real_type nx_Begin_SAE() const

    Intial normal x-coordinate (SAE).

  inline real_type ny_Begin_SAE() const

    Intial normal y-coordinate (SAE).

  inline real_type nx_End_SAE() const

    Final normal x-coordinate (SAE).

  inline real_type ny_End_SAE() const

    Intial normal y-coordinate (SAE).

  inline real_type kappa(real_type s) const

    Ccurvature at curvilinear coodinate `s`.

  inline real_type kappa_D(real_type s) const

    Curvature derivative at curvilinear coodinate `s`.

  inline real_type kappa_DD(real_type s) const

    Curvature second derivative at curvilinear coodinate `s`.

  inline real_type nx_ISO(real_type s) const

    Normal x-coordinate at curvilinear coodinate `s` (ISO).

  inline real_type nx_ISO_D(real_type s) const

    Normal derivative x-coordinate at curvilinear coodinate `s` (ISO).

  inline real_type nx_ISO_DD(real_type s) const

    Normal second derivative x-coordinate at curvilinear coodinate `s` (ISO).

  inline real_type nx_ISO_DDD(real_type s) const

    Normal third derivative x-coordinate at curvilinear coodinate `s` (ISO).

  inline real_type ny_ISO(real_type s) const

    Normal y-coordinate at curvilinear coodinate `s` (ISO).

  inline real_type ny_ISO_D(real_type s) const

    Normal derivative y-coordinate at curvilinear coodinate `s` (ISO).

  inline real_type ny_ISO_DD(real_type s) const

    Normal second derivative y-coordinate at curvilinear coodinate `s` (ISO).

  inline real_type ny_ISO_DDD(real_type s) const

    Normal third derivative y-coordinate at curvilinear coodinate `s` (ISO).

  inline real_type nx_SAE(real_type s) const

    Normal x-coordinate at curvilinear coodinate `s` (SAE).

  inline real_type nx_SAE_D(real_type s) const

    Normal derivative x-coordinate at curvilinear coodinate `s` (SAE).

  inline real_type nx_SAE_DD(real_type s) const

    Normal second derivative x-coordinate at curvilinear coodinate `s` (SAE).

  inline real_type nx_SAE_DDD(real_type s) const

    Normal third derivative x-coordinate at curvilinear coodinate `s` (SAE).

  inline real_type ny_SAE(real_type s) const

    Normal y-coordinate at curvilinear coodinate `s` (ISO)

  inline real_type ny_SAE_D(real_type s) const

    Normal derivative y-coordinate at curvilinear coodinate `s` (SAE).

  inline real_type ny_SAE_DD(real_type s) const

    Normal second derivative x-coordinate at curvilinear coodinate `s` (SAE).

  inline real_type ny_SAE_DDD(real_type s) const

    Normal third derivative y-coordinate at curvilinear coodinate `s` (SAE).

  inline void nor_ISO(real_type s, real_type &nx, real_type &ny) const

    Normal at curvilinear coodinate `s` (ISO).

  inline void nor_ISO_D(real_type s, real_type &nx_D, real_type &ny_D) const

    Normal derivative at curvilinear coodinate `s` (ISO).

  inline void nor_ISO_DD(real_type s, real_type &nx_DD, real_type &ny_DD) const

    Normal second derivative at curvilinear coodinate `s` (ISO).

  inline void nor_ISO_DDD(real_type s, real_type &nx_DDD, real_type &ny_DDD) const

    Normal third derivative at curvilinear coodinate `s` (ISO).

  inline void nor_SAE(real_type s, real_type &nx, real_type &ny) const

    Normal at curvilinear coodinate `s` (SAE).

  inline void nor_SAE_D(real_type s, real_type &nx_D, real_type &ny_D) const

    Normal derivative at curvilinear coodinate `s` (SAE).

  inline void nor_SAE_DD(real_type s, real_type &nx_DD, real_type &ny_DD) const

    Normal second derivative at curvilinear coodinate `s` (SAE).

  inline void nor_SAE_DDD(real_type s, real_type &nx_DDD, real_type &ny_DDD) const

    Normal third at curvilinear coodinate `s` (SAE).

  inline virtual void evaluate_ISO(real_type s, real_type offs, real_type &th, real_type &k, real_type &x, real_type &y) const

    Evaluate curve with offset at curvilinear coordinate `s` (ISO).

    Parameters

      - s – [in] curvilinear coordinate

      - offs – [in] offset

      - th – [out] angle

      - k – [out] curvature

      - x – [out] x-coordinate

      - y – [out] y-coordinate

  inline virtual void evaluate_SAE(real_type s, real_type offs, real_type &th, real_type &k, real_type &x, real_type &y) const

    Evaluate curve with offset at curvilinear coordinate `s` (SAE).

    Parameters

      - s – [in] curvilinear coordinate

      - offs – [in] offset

      - th – [out] angle

      - k – [out] curvature

      - x – [out] x-coordinate

      - y – [out] y-coordinate

  virtual real_type X_ISO(real_type s, real_type offs) const

    x-coordinate at curvilinear coordinate `s` with offset `offs` (ISO).

  virtual real_type Y_ISO(real_type s, real_type offs) const

    y-coordinate at curvilinear coordinate `s` with offset `offs` (ISO).

  virtual real_type X_ISO_D(real_type s, real_type offs) const

    x-coordinate derivative at curvilinear coordinate `s` with offset `offs` (ISO).

  virtual real_type Y_ISO_D(real_type s, real_type offs) const

    y-coordinate derivative at curvilinear coordinate `s` with offset `offs` (ISO).

  virtual real_type X_ISO_DD(real_type s, real_type offs) const

    x-coordinate second derivative at curvilinear coordinate `s` with offset `offs` (ISO).

  virtual real_type Y_ISO_DD(real_type s, real_type offs) const

    y-coordinate second derivative at curvilinear coordinate `s` with offset `offs` (ISO).

  virtual real_type X_ISO_DDD(real_type s, real_type offs) const

    x-coordinate third derivative at curvilinear coordinate `s` with offset `offs` (ISO).

  virtual real_type Y_ISO_DDD(real_type s, real_type offs) const

    y-coordinate third derivative at curvilinear coordinate `s` with offset `offs` (ISO).

  inline real_type X_SAE(real_type s, real_type offs) const

    x-coordinate at curvilinear coordinate `s` with offset `offs` (SAE).

  inline real_type Y_SAE(real_type s, real_type offs) const

    y-coordinate at curvilinear coordinate `s` with offset `offs` (SAE).

  inline real_type X_SAE_D(real_type s, real_type offs) const

    x-coordinate derivative at curvilinear coordinate `s` with offset `offs` (SAE).

  inline real_type Y_SAE_D(real_type s, real_type offs) const

    y-coordinate derivative at curvilinear coordinate `s` with offset `offs` (SAE).

  inline real_type X_SAE_DD(real_type s, real_type offs) const

    x-coordinate second derivative at curvilinear coordinate `s` with offset `offs` (SAE).

  inline real_type Y_SAE_DD(real_type s, real_type offs) const

    y-coordinate second derivative at curvilinear coordinate `s` with offset `offs` (SAE).

  inline real_type X_SAE_DDD(real_type s, real_type offs) const

    x-coordinate third derivative at curvilinear coordinate `s` with offset `offs` (SAE).

  inline real_type Y_SAE_DDD(real_type s, real_type offs) const

    y-coordinate third derivative at curvilinear coordinate `s` with offset `offs` (SAE).

  virtual void eval_ISO(real_type s, real_type offs, real_type &x, real_type &y) const

    Compute curve at position `s` with offset `offs` (ISO).

    Parameters

      - s – [in] parameter on the curve

      - offs – [in] offset of the curve

      - x – [out] coordinate

      - y – [out] coordinate

  inline void eval_SAE(real_type s, real_type offs, real_type &x, real_type &y) const

    Compute curve at position `s` with offset `offs` (SAE).

    Parameters

      - s – [in] parameter on the curve

      - offs – [in] offset of the curve

      - x – [out] coordinate

      - y – [out] coordinate

  virtual void eval_ISO_D(real_type s, real_type offs, real_type &x_D, real_type &y_D) const

    Compute derivative curve at position `s` with offset `offs` (ISO).

    Parameters

      - s – [in] parameter on the curve

      - offs – [in] offset of the curve

      - x_D – [out] x-coordinate

      - y_D – [out] y-coordinate

  inline void eval_SAE_D(real_type s, real_type offs, real_type &x_D, real_type &y_D) const

    Compute derivative curve at position `s` with offset `offs` (SAE).

    Parameters

      - s – [in] parameter on the curve

      - offs – [in] offset of the curve

      - x_D – [out] x-coordinate first derivative

      - y_D – [out] y-coordinate first derivative

  virtual void eval_ISO_DD(real_type s, real_type offs, real_type &x_DD, real_type &y_DD) const

    Compute second derivative curve at position `s` with offset `offs` (ISO).

    Parameters

      - s – [in] parameter on the curve

      - offs – [in] offset of the curve

      - x_DD – [out] x-coordinate second derivative

      - y_DD – [out] y-coordinate second derivative

  inline void eval_SAE_DD(real_type s, real_type offs, real_type &x_DD, real_type &y_DD) const

    Compute second derivative curve at position `s` with offset `offs` (SAE).

    Parameters

      - s – [in] parameter on the curve

      - offs – [in] offset of the curve

      - x_DD – [out] x-coordinate second derivative

      - y_DD – [out] y-coordinate second derivative

  virtual void eval_ISO_DDD(real_type s, real_type offs, real_type &x_DDD, real_type &y_DDD) const

    Compute third derivative curve at position `s` with offset `offs` (ISO).

    Parameters

      - s – [in] parameter on the curve

      - offs – [in] offset of the curve

      - x_DDD – [out] x-coordinate third derivative

      - y_DDD – [out] y-coordinate third derivative

  inline void eval_SAE_DDD(real_type s, real_type offs, real_type &x_DDD, real_type &y_DDD) const

    Compute third derivative curve at position `s` with offset `offs` (SAE).

    Parameters

      - s – [in] parameter on the curve

      - offs – [in] offset of the curve

      - x_DDD – [out] x-coordinate third derivative

      - y_DDD – [out] y-coordinate third derivative

  inline bool collision(BaseCurve const &C) const

    Check collision with another curve.

  inline bool collision_ISO(real_type offs, BaseCurve const &C, real_type offs_C) const

    Check collision with another curve with offset (ISO).

    Parameters

      - offs – [in] curve offset

      - C – [in] second curve to check collision

      - offs_C – [in] curve offset of the second curve

    Returns

      true if collision is detected

  inline bool collision_SAE(real_type offs, BaseCurve const &C, real_type offs_C) const

    Check collision with another curve with offset (SAE).

    Parameters

      - offs – [in] curve offset

      - C – [in] second curve to check collision

      - offs_C – [in] curve offset of the second curve

    Returns

      true if collision is detected

  inline void intersect(BaseCurve const &C, IntersectList &ilist, bool swap_s_vals) const

    Intersect the curve with another curve.

    Parameters

      - C – [in] second curve intersect

      - ilist – [out] list of the intersection (as parameter on the curves)

      - swap_s_vals – [in] if true store `(s2,s1)` instead of `(s1,s2)` for each intersection

  inline void intersect_ISO(real_type offs, BaseCurve const &C, real_type offs_C, IntersectList &ilist, bool swap_s_vals) const

    Intersect the curve with another curve with offset (ISO)

    Parameters

      - offs – [in] offset first curve

      - C – [in] second curve intersect

      - offs_C – [in] offset second curve

      - ilist – [out] list of the intersection (as parameter on the curves)

      - swap_s_vals – [in] if true store `(s2,s1)` instead of `(s1,s2)` for each intersection

  inline void intersect_SAE(real_type offs, BaseCurve const &C, real_type offs_C, IntersectList &ilist, bool swap_s_vals) const

    Intersect the curve with another curve with offset (SAE).

    Parameters

      - offs – [in] offset first curve

      - C – [in] second curve intersect

      - offs_C – [in] offset second curve

      - ilist – [out] list of the intersection (as parameter on the curves)

      - swap_s_vals – [in] if true store `(s2,s1)` instead of `(s1,s2)` for each intersection

  inline int_type closestPoint_SAE(real_type qx, real_type qy, real_type &x, real_type &y, real_type &s, real_type &t, real_type &dst) const

    Given a point find closest point on the curve.

    Parameters

      - qx – x-coordinate of the point

      - qy – y-coordinate of the point

      - x – x-coordinate of the projected point on the curve

      - y – y-coordinate of the projected point on the curve

      - s – parameter on the curve of the projection

      - t – curvilinear coordinate of the point x,y (if orthogonal projection)

      - dst – distance point projected point

    Returns

      1 = point is projected orthogonal 0 = more than one projection (first returned) -1 = minimum point is not othogonal projection to curve

  inline int_type closestPoint_SAE(real_type qx, real_type qy, real_type offs, real_type &x, real_type &y, real_type &s, real_type &t, real_type &dst) const

    Given a point find closest point on the curve.

    Parameters

      - qx – x-coordinate of the point

      - qy – y-coordinate of the point

      - offs – offset of the curve

      - x – x-coordinate of the projected point on the curve

      - y – y-coordinate of the projected point on the curve

      - s – parameter on the curve of the projection

      - t – curvilinear coordinate of the point x,y (if orthogonal projection)

      - dst – distance point projected point

    Returns

      1 = point is projected orthogonal 0 = more than one projection (first returned) -1 = minimum point is not othogonal projection to curve

  inline virtual real_type distance(real_type qx, real_type qy) const

    Compute the distance between a point \( q=(q_x,q_y) \) and the curve.

    Parameters

      - qx – [in] component \( q_x \)

      - qy – [in] component \( q_y \)

    Returns

      the computed distance

  inline real_type distance_ISO(real_type qx, real_type qy, real_type offs) const

    Compute the distance between a point \( q=(q_x,q_y) \) and the curve with offset (ISO).

    Parameters

      - qx – [in] component \( q_x \)

      - qy – [in] component \( q_y \)

      - offs – [in] offset of the curve

    Returns

      the computed distance

  inline real_type distance_SAE(real_type qx, real_type qy, real_type offs) const

    Compute the distance between a point \( q=(q_x,q_y) \) and the curve with offset (SAE).

    Parameters

      - qx – [in] component \( q_x \)

      - qy – [in] component \( q_y \)

      - offs – [in] offset of the curve

    Returns

      the computed distance

  inline bool findST_ISO(real_type x, real_type y, real_type &s, real_type &t) const

    Find the curvilinear coordinate of point \( P=(x,y) \) respect to the curve (ISO), i.e.

    \[ P = C(s)+N(s)t \]

    where \( C(s) \) is the curve position respect to the curvilinear coordinates and \( C(s) \) is the normal at the point \( C(s) \).

    Parameters

      - x – [in] component \( x \)

      - y – [in] component \( y \)

      - s – [out] curvilinear coordinate

      - t – [out] offset respect to the curve of \( (x,y) \)

    Returns

      true if the coordinate are found

  inline bool findST_SAE(real_type x, real_type y, real_type &s, real_type &t) const

    Find the curvilinear coordinate of point \( (x,y) \) respect to the curve (SAE), i.e.

    \[ P = C(s)+N(s)t \]

    where \( C(s) \) is the curve position respect to the curvilinear coordinates and \( C(s) \) is the normal at the point \( C(s) \).

    Parameters

      - x – [in] component \( x \)

      - y – [in] component \( y \)

      - s – [out] curvilinear coordinate

      - t – [out] offset respect to the curve of \( (x,y) \)

    Returns

      true if the coordinate are found

  Friends

  friend class ClothoidCurve
  friend ostream_type &operator<<(ostream_type &stream, CircleArc const &c)

    Pretty print circle arc.