/** * \file Cone3D.cpp * \brief simple implementation of cones in 3D * * Copyright 2007-2013 IMP Inventors. All rights reserved. */ #include IMPALGEBRA_BEGIN_NAMESPACE Cone3D::Cone3D(const Segment3D &s,double radius): seg_(s), radius_(radius) { } bool Cone3D::get_contains(const Vector3D &v) const { Vector3D d = (v - get_tip()).get_unit_vector(); double x = std::acos(d*get_direction().get_unit_vector()); return (x >= 0) && (x < (get_angle()/2)) && (get_distance(v,get_tip())