41 std::optional<Geom::Point> no_point;
42 if (fabs(denom) < 1e-6)
72 g_warning (
"Point does not lie on line.\n");
84 return std::make_pair (HUGE_VAL, HUGE_VAL);
89 return std::make_pair (lambda1, lambda2);
95 std::pair<double, double> coords =
coordinates (v1, v2,
w);
96 if (coords.first == HUGE_VAL) {
101 return (coords.first >= 0 && coords.second >= 0);
119std::pair<Geom::Point, Geom::Point>
128 std::pair<Geom::Point, Geom::Point>
result;
133 result = std::make_pair (A, B);
138 if (tmp_angle > angle) {
140 result = std::make_pair (B, C);
145 if (tmp_angle > angle) {
147 result = std::make_pair (C,
D);
152 if (tmp_angle > angle) {
154 result = std::make_pair (
D, A);
159 return std::make_pair (A, A);
169 std::pair <Geom::Point, Geom::Point> e =
side_of_intersection (vb.corner(0), vb.corner(1), vb.corner(2), vb.corner(3), this->pt, this->v_dir);
170 if (e.first == e.second) {
172 return std::optional<Geom::Point>();
175 Line line (e.first, e.second);
Line(Geom::Point const &start, Geom::Point const &vec, bool is_endpoint=true)
Draw a line beginning at 'start'.
Geom::Point point_from_lambda(double const lambda)
Line & operator=(Line const &line)
static bool pts_coincide(Geom::Point const pt1, Geom::Point const pt2)
Geom::Point closest_to(Geom::Point const &pt)
void set_direction(Geom::Point const &dir)
virtual std::optional< Geom::Point > intersect(Line const &line)
double lambda(Geom::Point const pt)
std::optional< Geom::Point > intersection_with_viewbox(SPDesktop *desktop)
Two-dimensional point that doubles as a vector.
constexpr Point ccw() const
Return a point like this point but rotated -90 degrees.
To do: update description of desktop.
Geom::Parallelogram get_display_area() const
Return canvas viewbox in desktop coordinates.
static T det(T a, T b, T c, T d)
Editable view implementation.
double Coord
Floating point type used to store coordinates.
Perspective line for 3D perspectives.
static double pos_angle(Geom::Point v, Geom::Point w)
std::pair< double, double > coordinates(Geom::Point const &v1, Geom::Point const &v2, Geom::Point const &w)
double determinant(Geom::Point const &a, Geom::Point const &b)
bool lies_in_sector(Geom::Point const &v1, Geom::Point const &v2, Geom::Point const &w)
std::pair< Geom::Point, Geom::Point > side_of_intersection(Geom::Point const &A, Geom::Point const &B, Geom::Point const &C, Geom::Point const &D, Geom::Point const &pt, Geom::Point const &dir)
bool lies_in_quadrangle(Geom::Point const &A, Geom::Point const &B, Geom::Point const &C, Geom::Point const &D, Geom::Point const &pt)
double atan2(Point const &p)
SBasis L2(D2< SBasis > const &a, unsigned k)
T dot(D2< T > const &a, D2< T > const &b)
static double sign(double const x)
Returns -1 or 1 according to the sign of x.