BRL-CAD
tri_pt.h
Go to the documentation of this file.
1/* T R I _ P T . H
2 * BRL-CAD
3 *
4 * Copyright (c) 2004-2023 United States Government as represented by
5 * the U.S. Army Research Laboratory.
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public License
9 * version 2.1 as published by the Free Software Foundation.
10 *
11 * This library is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this file; see the file named COPYING for more
18 * information.
19 */
20
21/*----------------------------------------------------------------------*/
22/* @file tri_pt.h */
23/** @addtogroup bg_tri_pt */
24/** @{ */
25
26/**
27 * @brief
28 *
29 * Calculate the minimum distance from a point to a triangle
30 *
31 */
32
33#ifndef BG_TRI_PT_H
34#define BG_TRI_PT_H
35
36#include "common.h"
37#include "vmath.h"
38#include "bg/defines.h"
39
40__BEGIN_DECLS
41
42/* The parameter closest_pt is optional = if supplied, it will hold the closest
43 * point found. The return value is the distance between TP and the closest_pt
44 * to TP on the triangle. */
45BG_EXPORT extern double bg_tri_closest_pt(
46 point_t *closest_pt,
47 const point_t TP,
48 const point_t V0,
49 const point_t V1,
50 const point_t V2
51 );
52
53__END_DECLS
54
55#endif /* BG_TRI_TRI_H */
56/** @} */
57/*
58 * Local Variables:
59 * mode: C
60 * tab-width: 8
61 * indent-tabs-mode: t
62 * c-file-style: "stroustrup"
63 * End:
64 * ex: shiftwidth=4 tabstop=8
65 */
Header file for the BRL-CAD common definitions.
double bg_tri_closest_pt(point_t *closest_pt, const point_t TP, const point_t V0, const point_t V1, const point_t V2)
Calculate the minimum distance from a point to a triangle.
fastf_t point_t[ELEMENTS_PER_POINT]
3-tuple point
Definition: vmath.h:351
fundamental vector, matrix, quaternion math macros