libcruft-util/geom/cylinder.hpp

29 lines
732 B
C++
Raw Normal View History

2015-10-14 15:32:53 +11:00
/*
2018-08-04 15:14:06 +10:00
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
2015-10-14 15:32:53 +11:00
*
* Copyright 2015 Danny Robson <danny@nerdcruft.net>
*/
#ifndef __UTIL_GEOM_CYLINDER_HPP
#define __UTIL_GEOM_CYLINDER_HPP
#include "../point.hpp"
2017-01-05 15:06:49 +11:00
///////////////////////////////////////////////////////////////////////////////
namespace cruft::geom {
2015-10-14 15:32:53 +11:00
template <size_t S, typename T>
struct cylinder {
cruft::point<S,T> p0, p1;
2015-10-14 15:32:53 +11:00
T radius;
float distance (cruft::point<S,T>) const;
bool includes (cruft::point<S,T>) const;
2015-10-14 15:32:53 +11:00
};
using cylinder3f = cylinder<3,float>;
2017-01-05 15:06:49 +11:00
}
2015-10-14 15:32:53 +11:00
#endif