Lines Matching defs:line
3 * \brief Infinite straight line
60 /** @brief Create a default horizontal line.
61 * Creates a line with unit speed going in +X direction. */
65 /** @brief Create a line with the specified inclination.
66 * @param origin One of the points on the line
67 * @param angle Angle of the line in mathematical convention */
76 /** @brief Create a line going through two points.
86 /** @brief Create a line based on the coefficients of its equation.
92 /// Create a line by extending a line segment.
98 /// Create a line by extending a ray.
104 /// Create a line normal to a vector at a specified distance from origin.
110 /** @brief Create a line from origin and unit vector.
111 * Note that each line direction has two possible unit vectors.
112 * @param o Point through which the line will pass
113 * @param v Unit vector of the line's direction */
124 /// @name Retrieve and set the line's parameters.
127 /// Get the line's origin point.
129 /** @brief Get the line's raw direction vector.
132 /** @brief Get the line's normalized direction vector.
135 /// Angle the line makes with the X axis, in mathematical convention.
151 /** @brief Set the speed of the line.
157 /** @brief Set the angle the line makes with the X axis.
166 /// Set a line based on two points it should pass through.
172 /** @brief Set the coefficients of the line equation.
173 * The line equation is: \f$ax + by = c\f$. Points that satisfy the equation
174 * are on the line. */
177 /** @brief Get the coefficients of the line equation as a vector.
182 /// Get the coefficients of the line equation by reference.
185 /** @brief Check if the line has more than one point.
186 * A degenerate line can be created if the line is created from a line equation
188 * @return True if the line has no points or exactly one point */
192 /// Check if the line is horizontal (y is constant).
196 /// Check if the line is vertical (x is constant).
201 /** @brief Reparametrize the line so that it has unit speed.
202 * Note that the direction of the line may also change. */
204 // this helps with the nasty case of a line that starts somewhere far
213 /** @brief Return a new line reparametrized for unit speed. */
222 /// @name Evaluate the line as a function.
240 /** @brief Get a time value corresponding to a projection of a point on the line.
249 /** @brief Find a point on the line closest to the query point.
259 /// @name Create other objects based on this line.
264 /** @brief Create a line containing the same points, but in opposite direction.
271 /** @brief Same as segment(), but allocate the line segment dynamically. */
278 /** @brief Create a segment of this line.
281 * @return Created line segment */
286 /// Return the portion of the line that is inside the given rectangle
290 * The created ray will go in the direction of the line's vector (in the direction
301 /** @brief Create a derivative of the line.
302 * The new line will always be degenerate. Its origin will be equal to this
303 * line's vector. */
310 /// Create a line transformed by an affine transformation.
316 /** @brief Get a unit vector normal to the line.
330 /// Compute an affine matrix representing a reflection about the line.
341 /** @brief Compute an affine which transforms all points on the line to zero X or Y coordinate.
345 * additionaly moves the initial point of the line to (0,0). This way it works without
348 * @param d Which coordinate of points on the line should be zero after the transformation */
359 /** @brief Compute a rotation affine which transforms the line to one of the axes.
360 * @param d Which line should be the axis */
397 * A helper used to implement line segment intersections.
405 /// @brief Compute distance from point to line.
408 double distance(Point const &p, Line const &line)
410 if (line.isDegenerate()) {
411 return ::Geom::distance(p, line.initialPoint());
413 Coord t = line.nearestTime(p);
414 return ::Geom::distance(line.pointAt(t), p);
419 bool are_near(Point const &p, Line const &line, double eps = EPSILON)
421 return are_near(distance(p, line), 0, eps);
431 * This tests for being parallel and the origin of one line being close to the other,
433 * correspond to similar points. For example a line from (1,1) to (2,2) and a line from
476 // build a line passing by _point and orthogonal to _line
478 Line make_orthogonal_line(Point const &p, Line const &line)
480 Point d = line.vector().cw();
485 // build a line passing by _point and parallel to _line
487 Line make_parallel_line(Point const &p, Line const &line)
489 Line result(line);
494 // build a line passing by the middle point of _segment and orthogonal to it.
501 // build the bisector line of the angle between ray(O,A) and ray(O,B)
512 Point projection(Point const &p, Line const &line)
514 return line.pointAt(line.nearestTime(p));
518 LineSegment projection(LineSegment const &seg, Line const &line)
520 return line.segment(line.nearestTime(seg.initialPoint()),
521 line.nearestTime(seg.finalPoint()));