31#ifndef LIB2GEOM_SEEN_RAY_H
32#define LIB2GEOM_SEEN_RAY_H
96 if (t >= 0)
result.push_back(t);
97 }
else if (
_vector[(d+1)%2] == v) {
98 THROW_INFINITESOLUTIONS();
128 return ::Geom::distance(_point, _ray.
pointAt(t));
147 if (angle < 0) angle += 2*M_PI;
148 if (!cw) angle = 2*M_PI - angle;
171 THROW_RANGEERROR(
"passed rays do not have the same origin");
176 return (cw ? bisector : bisector.
reverse());
Defines the different types of exceptions that 2geom can throw.
Cartesian point / 2D vector and related operations.
Various trigoniometric helper functions.
3x3 matrix representing an affine transformation.
Abstract continuous curve on a plane defined on [0,1].
Two-dimensional point that doubles as a vector.
void normalize()
Normalize the vector representing the point.
Straight ray from a specific point to infinity.
std::vector< Coord > roots(Coord v, Dim2 d) const
Ray transformed(Affine const &m) const
void setPoints(Point const &a, Point const &b)
Coord nearestTime(Point const &point) const
LineSegment segment(Coord f, Coord t) const
Ray(Point const &origin, Coord angle)
Curve * portion(Coord f, Coord t) const
Ray(Point const &A, Point const &B)
void setVector(Point const &v)
Coord valueAt(Coord t, Dim2 d) const
void setOrigin(Point const &o)
Point pointAt(Coord t) const
bool isDegenerate() const
Rotation around the origin.
BezierCurveN< 1 > LineSegment
Line segment.
Dim2
2D axis enumeration (X or Y).
double Coord
Floating point type used to store coordinates.
constexpr Coord EPSILON
Default "acceptably small" value.
Low level math functions and compatibility wrappers.
Various utility functions.
void sincos(double angle, double &sin_, double &cos_)
Simultaneously compute a sine and a cosine of the same angle.
Ray make_angle_bisector_ray(Ray const &r1, Ray const &r2, bool cw=true)
Returns the angle bisector for the two given rays.
bool are_same(Ray const &r1, Ray const &r2, double eps=EPSILON)
Angle distance(Angle const &a, Angle const &b)
double angle_between(Line const &l1, Line const &l2)
T dot(D2< T > const &a, D2< T > const &b)
bool are_near(Affine const &a1, Affine const &a2, Coord eps=EPSILON)