ostk.mathematics.geometry.d3.object.Cone¶
- class Cone(self: ostk.mathematics.geometry.d3.object.Cone, apex: ostk.mathematics.geometry.d3.object.Point, axis: numpy.ndarray[numpy.float64[3, 1]], angle: ostk::mathematics::geometry::Angle)¶
 Bases:
ObjectCreate a 3D cone with specified apex, axis, and angle.
- Parameters:
 
Example
>>> apex = Point(0.0, 0.0, 0.0) >>> axis = numpy.array([0.0, 0.0, 1.0]) >>> angle = Angle.degrees(30.0) >>> cone = Cone(apex, axis, angle)
Methods
Apply a transformation to the cone in place.
Convert the object to a cone.
Convert the object to an ellipsoid.
Convert the object to a line.
Convert the object to a line string.
Convert the object to a plane.
Convert the object to a point.
Convert the object to a point set.
Convert the object to a polygon.
Convert the object to a pyramid.
Convert the object to a ray.
Convert the object to a segment.
Convert the object to a sphere.
Overloaded function.
Calculate the distance from the cone to a point.
Get the half-angle of the cone opening.
Get the apex (tip) point of the cone.
Get the axis direction vector of the cone.
Get rays representing the lateral surface of the cone.
Overloaded function.
Overloaded function.
Check if the object is a cone.
Check if the cone is defined.
Check if the object is an ellipsoid.
Check if the object is a line.
Check if the object is a line string.
Check if the object is a plane.
Check if the object is a point.
Check if the object is a point set.
Check if the object is a polygon.
Check if the object is a pyramid.
Check if the object is a ray.
Check if the object is a segment.
Check if the object is a sphere.
Create an undefined cone.
- apply_transformation(
 - self: ostk.mathematics.geometry.d3.object.Cone, 
- transformation: ostk::mathematics::geometry::d3::Transformation,
  Apply a transformation to the cone in place.
- Parameters:
 transformation (Transformation) -- The transformation to apply.
Example
>>> cone = Cone(Point(0.0, 0.0, 0.0), numpy.array([0.0, 0.0, 1.0]), Angle.degrees(30.0)) >>> transformation = Translation([1.0, 2.0, 3.0]) >>> cone.apply_transformation(transformation)
- as_cone( ) ostk::mathematics::geometry::d3::object::Cone¶
 Convert the object to a cone.
- Returns:
 The cone.
- Return type:
 
- as_ellipsoid( ) ostk::mathematics::geometry::d3::object::Ellipsoid¶
 Convert the object to an ellipsoid.
- Returns:
 The ellipsoid.
- Return type:
 
- as_line( ) ostk::mathematics::geometry::d3::object::Line¶
 Convert the object to a line.
- Returns:
 The line.
- Return type:
 
- as_line_string( ) ostk::mathematics::geometry::d3::object::LineString¶
 Convert the object to a line string.
- Returns:
 The line string.
- Return type:
 
- as_plane( ) ostk::mathematics::geometry::d3::object::Plane¶
 Convert the object to a plane.
- Returns:
 The plane.
- Return type:
 
- as_point( ) ostk::mathematics::geometry::d3::object::Point¶
 Convert the object to a point.
- Returns:
 The point.
- Return type:
 
- as_point_set( ) ostk::mathematics::geometry::d3::object::PointSet¶
 Convert the object to a point set.
- Returns:
 The point set.
- Return type:
 
- as_polygon( ) ostk::mathematics::geometry::d3::object::Polygon¶
 Convert the object to a polygon.
- Returns:
 The polygon.
- Return type:
 
- as_pyramid( ) ostk::mathematics::geometry::d3::object::Pyramid¶
 Convert the object to a pyramid.
- Returns:
 The pyramid.
- Return type:
 
- as_ray( ) ostk::mathematics::geometry::d3::object::Ray¶
 Convert the object to a ray.
- Returns:
 The ray.
- Return type:
 
- as_segment( ) ostk::mathematics::geometry::d3::object::Segment¶
 Convert the object to a segment.
- Returns:
 The segment.
- Return type:
 
- as_sphere( ) ostk::mathematics::geometry::d3::object::Sphere¶
 Convert the object to a sphere.
- Returns:
 The sphere.
- Return type:
 
- contains(*args, **kwargs)¶
 Overloaded function.
contains(self: ostk.mathematics.geometry.d3.object.Cone, point: ostk.mathematics.geometry.d3.object.Point) -> bool
Check if the cone contains a point.
- Args:
 point (Point): The point to check.
- Returns:
 bool: True if the cone contains the point, False otherwise.
- Example:
 >>> cone = Cone(Point(0.0, 0.0, 0.0), numpy.array([0.0, 0.0, 1.0]), Angle.degrees(30.0)) >>> cone.contains(Point(0.1, 0.1, 1.0)) # True for point inside cone
contains(self: ostk.mathematics.geometry.d3.object.Cone, point_set: ostk.mathematics.geometry.d3.object.PointSet) -> bool
Check if the cone contains a point set.
- Args:
 point_set (PointSet): The point set to check.
- Returns:
 bool: True if the cone contains the point set, False otherwise.
- Example:
 >>> cone = Cone(Point(0.0, 0.0, 0.0), numpy.array([0.0, 0.0, 1.0]), Angle.degrees(30.0)) >>> cone.contains(PointSet([Point(0.1, 0.1, 1.0), Point(0.2, 0.2, 1.0)])) # True for points inside cone
contains(self: ostk.mathematics.geometry.d3.object.Cone, segment: ostk.mathematics.geometry.d3.object.Segment) -> bool
Check if the cone contains a segment.
- Args:
 segment (Segment): The segment to check.
- Returns:
 bool: True if the cone contains the segment, False otherwise.
- Example:
 >>> cone = Cone(Point(0.0, 0.0, 0.0), numpy.array([0.0, 0.0, 1.0]), Angle.degrees(30.0)) >>> cone.contains(Segment(Point(0.1, 0.1, 1.0), Point(0.2, 0.2, 1.0))) # True for segment inside cone
contains(self: ostk.mathematics.geometry.d3.object.Cone, ray: ostk.mathematics.geometry.d3.object.Ray) -> bool
Check if the cone contains a ray.
- Args:
 ray (Ray): The ray to check.
- Returns:
 bool: True if the cone contains the ray, False otherwise.
- Example:
 >>> cone = Cone(Point(0.0, 0.0, 0.0), numpy.array([0.0, 0.0, 1.0]), Angle.degrees(30.0)) >>> cone.contains(Ray(Point(0.1, 0.1, 1.0), numpy.array([0.0, 0.0, 1.0]))) # True for ray inside cone
contains(self: ostk.mathematics.geometry.d3.object.Cone, sphere: ostk.mathematics.geometry.d3.object.Sphere) -> bool
Check if the cone contains a sphere.
- Args:
 sphere (Sphere): The sphere to check.
- Returns:
 bool: True if the cone contains the sphere, False otherwise.
- Example:
 >>> cone = Cone(Point(0.0, 0.0, 0.0), numpy.array([0.0, 0.0, 1.0]), Angle.degrees(30.0)) >>> cone.contains(Sphere(Point(0.1, 0.1, 1.0), 0.1)) # True for sphere inside cone
contains(self: ostk.mathematics.geometry.d3.object.Cone, ellipsoid: ostk.mathematics.geometry.d3.object.Ellipsoid) -> bool
Check if the cone contains an ellipsoid. Args:
ellipsoid (Ellipsoid): The ellipsoid to check.
- Returns:
 bool: True if the cone contains the ellipsoid, False otherwise.
- Example:
 >>> cone = Cone(Point(0.0, 0.0, 0.0), numpy.array([0.0, 0.0, 1.0]), Angle.degrees(30.0)) >>> cone.contains(Ellipsoid(Point(0.1, 0.1, 1.0), 0.1, 0.1, 0.1)) # True for ellipsoid inside cone
- distance_to( ) ostk.core.type.Real¶
 Calculate the distance from the cone to a point.
- Parameters:
 point (Point) -- The point to calculate distance to.
- Returns:
 The minimum distance from the cone surface to the point.
- Return type:
 
Example
>>> cone = Cone(Point(0.0, 0.0, 0.0), numpy.array([0.0, 0.0, 1.0]), Angle.degrees(30.0)) >>> distance = cone.distance_to(Point(2.0, 0.0, 0.0))
- get_angle( ) ostk::mathematics::geometry::Angle¶
 Get the half-angle of the cone opening.
- Returns:
 The half-angle of the cone.
- Return type:
 
Example
>>> cone = Cone(Point(0.0, 0.0, 0.0), numpy.array([0.0, 0.0, 1.0]), Angle.degrees(30.0)) >>> angle = cone.get_angle() # 30 degrees
- get_apex( ) ostk.mathematics.geometry.d3.object.Point¶
 Get the apex (tip) point of the cone.
- Returns:
 The apex point of the cone.
- Return type:
 
Example
>>> cone = Cone(Point(1.0, 2.0, 3.0), numpy.array([0.0, 0.0, 1.0]), Angle.degrees(30.0)) >>> apex = cone.get_apex() # Point(1.0, 2.0, 3.0)
- get_axis( ) numpy.ndarray[numpy.float64[3, 1]]¶
 Get the axis direction vector of the cone.
- Returns:
 The axis direction vector.
- Return type:
 Vector3d
Example
>>> cone = Cone(Point(0.0, 0.0, 0.0), numpy.array([0.0, 0.0, 1.0]), Angle.degrees(30.0)) >>> axis = cone.get_axis() # [0.0, 0.0, 1.0]
- get_rays_of_lateral_surface(
 - self: ostk.mathematics.geometry.d3.object.Cone, 
- ray_count: int = 0,
  Get rays representing the lateral surface of the cone.
- Parameters:
 ray_count (int) -- Number of rays to generate around the surface.
- Returns:
 Array of Ray objects representing the lateral surface.
- Return type:
 
Example
>>> cone = Cone(Point(0.0, 0.0, 0.0), numpy.array([0.0, 0.0, 1.0]), Angle.degrees(30.0)) >>> rays = cone.get_rays_of_lateral_surface(8)
- intersection_with(*args, **kwargs)¶
 Overloaded function.
intersection_with(self: ostk.mathematics.geometry.d3.object.Cone, sphere: ostk.mathematics.geometry.d3.object.Sphere, only_in_sight: bool = False, discretization_level: int = 40) -> ostk::mathematics::geometry::d3::Intersection
Compute intersection of cone with sphere.
- Args:
 sphere (Sphere): The sphere to intersect with. only_in_sight (bool): If true, only return intersection points that are in sight. discretization_level (int): The discretization level for the intersection.
- Returns:
 Intersection: The intersection of the cone with the sphere.
- Example:
 >>> cone = Cone(Point(0.0, 0.0, 0.0), numpy.array([0.0, 0.0, 1.0]), Angle.degrees(30.0)) >>> sphere = Sphere(Point(2.0, 0.0, 0.0), 1.0) >>> intersection = cone.intersection_with(sphere) >>> intersection.get_point() # Point(2.0, 0.0, 0.0)
intersection_with(self: ostk.mathematics.geometry.d3.object.Cone, ellipsoid: ostk.mathematics.geometry.d3.object.Ellipsoid, only_in_sight: bool = False, discretization_level: int = 40) -> ostk::mathematics::geometry::d3::Intersection
Compute intersection of cone with ellipsoid.
- Args:
 ellipsoid (Ellipsoid): The ellipsoid to intersect with. only_in_sight (bool): If true, only return intersection points that are in sight. discretization_level (int): The discretization level for the intersection.
- Returns:
 Intersection: The intersection of the cone with the ellipsoid.
- Example:
 >>> cone = Cone(Point(0.0, 0.0, 0.0), numpy.array([0.0, 0.0, 1.0]), Angle.degrees(30.0)) >>> ellipsoid = Ellipsoid(Point(2.0, 0.0, 0.0), 1.0, 1.0, 1.0) >>> intersection = cone.intersection_with(ellipsoid) >>> intersection.get_point() # Point(2.0, 0.0, 0.0)
- intersects(*args, **kwargs)¶
 Overloaded function.
intersects(self: ostk.mathematics.geometry.d3.object.Cone, sphere: ostk.mathematics.geometry.d3.object.Sphere, discretization_level: int = 40) -> bool
Check if the cone intersects with a sphere.
- Args:
 sphere (Sphere): The sphere to check intersection with. discretization_level (int): Level of discretization for intersection calculation.
- Returns:
 bool: True if the cone intersects the sphere, False otherwise.
- Example:
 >>> cone = Cone(Point(0.0, 0.0, 0.0), numpy.array([0.0, 0.0, 1.0]), Angle.degrees(30.0)) >>> sphere = Sphere(Point(1.0, 0.0, 1.0), 0.5) >>> cone.intersects(sphere)
intersects(self: ostk.mathematics.geometry.d3.object.Cone, ellipsoid: ostk.mathematics.geometry.d3.object.Ellipsoid, discretization_level: int = 40) -> bool
Check if the cone intersects with an ellipsoid.
- Args:
 ellipsoid (Ellipsoid): The ellipsoid to check intersection with. discretization_level (int): Level of discretization for intersection calculation.
- Returns:
 bool: True if the cone intersects the ellipsoid, False otherwise.
- Example:
 >>> cone = Cone(Point(0.0, 0.0, 0.0), numpy.array([0.0, 0.0, 1.0]), Angle.degrees(30.0)) >>> ellipsoid = Ellipsoid(Point(1.0, 0.0, 1.0), 1.0, 0.8, 0.6) >>> cone.intersects(ellipsoid)
- is_cone(self: ostk.mathematics.geometry.d3.Object) bool¶
 Check if the object is a cone.
- Returns:
 True if the object is a cone.
- Return type:
 
- is_defined(self: ostk.mathematics.geometry.d3.object.Cone) bool¶
 Check if the cone is defined.
- Returns:
 True if the cone is defined, False otherwise.
- Return type:
 
Example
>>> cone = Cone(Point(0.0, 0.0, 0.0), numpy.array([0.0, 0.0, 1.0]), Angle.degrees(30.0)) >>> cone.is_defined() # True
- is_ellipsoid(self: ostk.mathematics.geometry.d3.Object) bool¶
 Check if the object is an ellipsoid.
- Returns:
 True if the object is an ellipsoid.
- Return type:
 
- is_line(self: ostk.mathematics.geometry.d3.Object) bool¶
 Check if the object is a line.
- Returns:
 True if the object is a line.
- Return type:
 
- is_line_string(self: ostk.mathematics.geometry.d3.Object) bool¶
 Check if the object is a line string.
- Returns:
 True if the object is a line string.
- Return type:
 
- is_plane(self: ostk.mathematics.geometry.d3.Object) bool¶
 Check if the object is a plane.
- Returns:
 True if the object is a plane.
- Return type:
 
- is_point(self: ostk.mathematics.geometry.d3.Object) bool¶
 Check if the object is a point.
- Returns:
 True if the object is a point.
- Return type:
 
- is_point_set(self: ostk.mathematics.geometry.d3.Object) bool¶
 Check if the object is a point set.
- Returns:
 True if the object is a point set.
- Return type:
 
- is_polygon(self: ostk.mathematics.geometry.d3.Object) bool¶
 Check if the object is a polygon.
- Returns:
 True if the object is a polygon.
- Return type:
 
- is_pyramid(self: ostk.mathematics.geometry.d3.Object) bool¶
 Check if the object is a pyramid.
- Returns:
 True if the object is a pyramid.
- Return type:
 
- is_ray(self: ostk.mathematics.geometry.d3.Object) bool¶
 Check if the object is a ray.
- Returns:
 True if the object is a ray.
- Return type:
 
- is_segment(self: ostk.mathematics.geometry.d3.Object) bool¶
 Check if the object is a segment.
- Returns:
 True if the object is a segment.
- Return type:
 
- is_sphere(self: ostk.mathematics.geometry.d3.Object) bool¶
 Check if the object is a sphere.
- Returns:
 True if the object is a sphere.
- Return type:
 
- static undefined() ostk.mathematics.geometry.d3.object.Cone¶
 Create an undefined cone.
- Returns:
 An undefined cone object.
- Return type:
 
Example
>>> undefined_cone = Cone.undefined() >>> undefined_cone.is_defined() # False