File indexing completed on 2024-05-12 15:27:08

0001 /***************************************************************************
0002     File                 : nsl_geom.h
0003     Project              : LabPlot
0004     Description          : NSL geometry functions
0005     --------------------------------------------------------------------
0006     Copyright            : (C) 2016 by Stefan Gerlach (stefan.gerlach@uni.kn)
0007 
0008  ***************************************************************************/
0009 
0010 /***************************************************************************
0011  *                                                                         *
0012  *  This program is free software; you can redistribute it and/or modify   *
0013  *  it under the terms of the GNU General Public License as published by   *
0014  *  the Free Software Foundation; either version 2 of the License, or      *
0015  *  (at your option) any later version.                                    *
0016  *                                                                         *
0017  *  This program is distributed in the hope that it will be useful,        *
0018  *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
0019  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
0020  *  GNU General Public License for more details.                           *
0021  *                                                                         *
0022  *   You should have received a copy of the GNU General Public License     *
0023  *   along with this program; if not, write to the Free Software           *
0024  *   Foundation, Inc., 51 Franklin Street, Fifth Floor,                    *
0025  *   Boston, MA  02110-1301  USA                                           *
0026  *                                                                         *
0027  ***************************************************************************/
0028 
0029 #ifndef NSL_GEOM_H
0030 #define NSL_GEOM_H
0031 
0032 /* point-point distance
0033     point (x1,y1) to (x2,y2)
0034  */
0035 double nsl_geom_point_point_dist(double x1, double y1, double x2, double y2);
0036 
0037 /* point-line distance sqrt(dx^2+dy^2)
0038     point (xp,yp) to line (x1,y1)-(x2,y2)
0039  */
0040 double nsl_geom_point_line_dist(double x1, double y1, double x2, double y2, double xp, double yp);
0041 
0042 /* point-line distance |dy|
0043     point (xp,yp) to line (x1,y1)-(x2,y2)
0044  */
0045 double nsl_geom_point_line_dist_y(double x1, double y1, double x2, double y2, double xp, double yp);
0046 
0047 /* area of triangle defined by three points */
0048 double nsl_geom_three_point_area(double x1, double y1, double x2, double y2, double x3, double y3);
0049 
0050 /* point-point distance in 3d
0051         point (x1,y1,z1) to (x2,y2,z2)
0052  */
0053 double nsl_geom_point_point_dist3(double x1, double y1, double z1, double x2, double y2, double z2);
0054 
0055 #endif /* NSL_GEOM_H */