/*
*
* Copyright (C) 2022 Jeremias Stotter
*
* This file is part of network-simulator.
*
* network-simulator is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
*
* network-simulator is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with network-simulator. If not, see .
*/
/*
This contains logic usefull for geometry in the drawing area in the gui
*/
#ifndef NS_GEOMETRY
#define NS_GEOMETRY
#include
struct coordinate {
double x;
double y;
};
int point_orientation(double a_x, double a_y,
double b_x, double b_y,
double c_x, double c_y);
bool line_line_intersect(double l1_a_x, double l1_a_y, double l1_b_x, double l1_b_y,
double l2_a_x, double l2_a_y, double l2_b_x, double l2_b_y);
bool rect_rect_intersect(double a_x1, double a_x2, double a_y1, double a_y2,
double b_x1, double b_x2, double b_y1, double b_y2);
struct coordinate offset_along_line(double x1, double y1, double x2, double y2, double offset);
#endif