ostk.mathematics.geometry.d3.object.Ellipsoid¶
- class Ellipsoid(*args, **kwargs)¶
Bases:
Object
Overloaded function.
__init__(self: ostk.mathematics.geometry.d3.object.Ellipsoid, center: ostk.mathematics.geometry.d3.object.Point, first_principal_semi_axis: ostk.core.type.Real, second_principal_semi_axis: ostk.core.type.Real, third_principal_semi_axis: ostk.core.type.Real) -> None
Create an ellipsoid with specified center and semi-axes.
- Args:
center (Point): The center point of the ellipsoid. first_principal_semi_axis (float): The first principal semi-axis length. second_principal_semi_axis (float): The second principal semi-axis length. third_principal_semi_axis (float): The third principal semi-axis length.
- Example:
>>> center = Point(0.0, 0.0, 0.0) >>> ellipsoid = Ellipsoid(center, 2.0, 1.5, 1.0)
__init__(self: ostk.mathematics.geometry.d3.object.Ellipsoid, center: ostk.mathematics.geometry.d3.object.Point, first_principal_semi_axis: ostk.core.type.Real, second_principal_semi_axis: ostk.core.type.Real, third_principal_semi_axis: ostk.core.type.Real, orientation: ostk::mathematics::geometry::d3::transformation::rotation::Quaternion) -> None
Create an ellipsoid with specified center, semi-axes, and orientation.
- Args:
center (Point): The center point of the ellipsoid. first_principal_semi_axis (float): The first principal semi-axis length. second_principal_semi_axis (float): The second principal semi-axis length. third_principal_semi_axis (float): The third principal semi-axis length. orientation (Quaternion): The orientation of the ellipsoid.
- Example:
>>> center = Point(0.0, 0.0, 0.0) >>> orientation = Quaternion.unit() >>> ellipsoid = Ellipsoid(center, 2.0, 1.5, 1.0, orientation)
Methods
Apply a transformation to the ellipsoid 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.
Get the center point of the ellipsoid.
Get the first axis of the ellipsoid.
Get the first principal semi-axis length.
Get the matrix of the ellipsoid.
Get the orientation quaternion of the ellipsoid.
Get the second axis of the ellipsoid.
Get the second principal semi-axis length.
Get the third axis of the ellipsoid.
Get the third principal semi-axis length.
Overloaded function.
Overloaded function.
Overloaded function.
Check if the object is a cone.
Check if the ellipsoid 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 ellipsoid.
- apply_transformation(
- self: ostk.mathematics.geometry.d3.object.Ellipsoid,
- transformation: ostk::mathematics::geometry::d3::Transformation,
Apply a transformation to the ellipsoid in place.
- Parameters:
transformation (Transformation) -- The transformation to apply.
Example
>>> ellipsoid = Ellipsoid(center, 2.0, 1.5, 1.0) >>> transformation = Translation([1.0, 2.0, 3.0]) >>> ellipsoid.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.Ellipsoid, point: ostk.mathematics.geometry.d3.object.Point) -> bool
Check if the ellipsoid contains a point.
- Args:
point (Point): The point to check.
- Returns:
bool: True if the ellipsoid contains the point, False otherwise.
- Example:
>>> ellipsoid = Ellipsoid(Point(0.0, 0.0, 0.0), 2.0, 1.5, 1.0) >>> ellipsoid.contains(Point(0.5, 0.5, 0.5)) # True if inside
contains(self: ostk.mathematics.geometry.d3.object.Ellipsoid, point_set: ostk.mathematics.geometry.d3.object.PointSet) -> bool
Check if the ellipsoid contains a point set.
- Args:
point_set (PointSet): The point set to check.
- Returns:
bool: True if the ellipsoid contains the point set, False otherwise.
- Example:
>>> ellipsoid = Ellipsoid(Point(0.0, 0.0, 0.0), 2.0, 1.5, 1.0) >>> ellipsoid.contains(PointSet([Point(0.5, 0.5, 0.5), Point(1.0, 1.0, 1.0)])) # True if inside
contains(self: ostk.mathematics.geometry.d3.object.Ellipsoid, segment: ostk.mathematics.geometry.d3.object.Segment) -> bool
Check if the ellipsoid contains a segment.
- Args:
segment (Segment): The segment to check.
- Returns:
bool: True if the ellipsoid contains the segment, False otherwise.
- Example:
>>> ellipsoid = Ellipsoid(Point(0.0, 0.0, 0.0), 2.0, 1.5, 1.0) >>> ellipsoid.contains(Segment(Point(0.5, 0.5, 0.5), Point(1.0, 1.0, 1.0))) # True if inside
- get_center( ) ostk.mathematics.geometry.d3.object.Point ¶
Get the center point of the ellipsoid.
- Returns:
The center point of the ellipsoid.
- Return type:
Example
>>> ellipsoid = Ellipsoid(Point(1.0, 2.0, 3.0), 2.0, 1.5, 1.0) >>> center = ellipsoid.get_center() # Point(1.0, 2.0, 3.0)
- get_first_axis( ) numpy.ndarray[numpy.float64[3, 1]] ¶
Get the first axis of the ellipsoid.
- Returns:
The first axis of the ellipsoid.
- Return type:
numpy.array
Example
>>> ellipsoid = Ellipsoid(center, 2.0, 1.5, 1.0) >>> first_axis = ellipsoid.get_first_axis() # numpy.array([1.0, 0.0, 0.0])
- get_first_principal_semi_axis( ) ostk.core.type.Real ¶
Get the first principal semi-axis length.
- Returns:
The length of the first principal semi-axis.
- Return type:
Example
>>> ellipsoid = Ellipsoid(center, 2.0, 1.5, 1.0) >>> first_axis = ellipsoid.get_first_principal_semi_axis() # 2.0
- get_matrix( ) numpy.ndarray[numpy.float64[3, 3]] ¶
Get the matrix of the ellipsoid.
- Returns:
The matrix of the ellipsoid.
- Return type:
numpy.array
Example
>>> ellipsoid = Ellipsoid(center, 2.0, 1.5, 1.0) >>> matrix = ellipsoid.get_matrix() # numpy.array([[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]])
- get_orientation( ) ostk::mathematics::geometry::d3::transformation::rotation::Quaternion ¶
Get the orientation quaternion of the ellipsoid.
- Returns:
The orientation quaternion of the ellipsoid.
- Return type:
Example
>>> ellipsoid = Ellipsoid(center, 2.0, 1.5, 1.0, orientation) >>> quat = ellipsoid.get_orientation()
- get_second_axis( ) numpy.ndarray[numpy.float64[3, 1]] ¶
Get the second axis of the ellipsoid.
- Returns:
The second axis of the ellipsoid.
- Return type:
numpy.array
Example
>>> ellipsoid = Ellipsoid(center, 2.0, 1.5, 1.0) >>> second_axis = ellipsoid.get_second_axis() # numpy.array([0.0, 1.0, 0.0])
- get_second_principal_semi_axis( ) ostk.core.type.Real ¶
Get the second principal semi-axis length.
- Returns:
The length of the second principal semi-axis.
- Return type:
Example
>>> ellipsoid = Ellipsoid(center, 2.0, 1.5, 1.0) >>> second_axis = ellipsoid.get_second_principal_semi_axis() # 1.5
- get_third_axis( ) numpy.ndarray[numpy.float64[3, 1]] ¶
Get the third axis of the ellipsoid.
- Returns:
The third axis of the ellipsoid.
- Return type:
numpy.array
Example
>>> ellipsoid = Ellipsoid(center, 2.0, 1.5, 1.0) >>> third_axis = ellipsoid.get_third_axis() # numpy.array([0.0, 0.0, 1.0])
- get_third_principal_semi_axis( ) ostk.core.type.Real ¶
Get the third principal semi-axis length.
- Returns:
The length of the third principal semi-axis.
- Return type:
Example
>>> ellipsoid = Ellipsoid(center, 2.0, 1.5, 1.0) >>> third_axis = ellipsoid.get_third_principal_semi_axis() # 1.0
- intersection(*args, **kwargs)¶
Overloaded function.
intersection(self: ostk.mathematics.geometry.d3.object.Ellipsoid, line: ostk.mathematics.geometry.d3.object.Line) -> ostk::mathematics::geometry::d3::Intersection
intersection(self: ostk.mathematics.geometry.d3.object.Ellipsoid, ray: ostk.mathematics.geometry.d3.object.Ray, only_in_sight: bool) -> ostk::mathematics::geometry::d3::Intersection
intersection(self: ostk.mathematics.geometry.d3.object.Ellipsoid, segment: ostk.mathematics.geometry.d3.object.Segment) -> ostk::mathematics::geometry::d3::Intersection
intersection(self: ostk.mathematics.geometry.d3.object.Ellipsoid, pyramid: ostk::mathematics::geometry::d3::object::Pyramid, only_in_sight: bool) -> ostk::mathematics::geometry::d3::Intersection
intersection(self: ostk.mathematics.geometry.d3.object.Ellipsoid, cone: ostk::mathematics::geometry::d3::object::Cone, only_in_sight: bool) -> ostk::mathematics::geometry::d3::Intersection
- intersection_with(*args, **kwargs)¶
Overloaded function.
intersection_with(self: ostk.mathematics.geometry.d3.object.Ellipsoid, line: ostk.mathematics.geometry.d3.object.Line) -> ostk::mathematics::geometry::d3::Intersection
Get the intersection of the ellipsoid with a line.
- Args:
line (Line): The line to intersect with.
- Returns:
Intersection: The intersection of the ellipsoid with the line.
- Example:
>>> ellipsoid = Ellipsoid(center, 2.0, 1.5, 1.0) >>> line = Line.points(Point(0.0, 0.0, 0.0), Point(1.0, 0.0, 0.0)) >>> intersection = ellipsoid.intersection_with(line) >>> intersection.get_point() # Point(0.0, 0.0, 0.0)
intersection_with(self: ostk.mathematics.geometry.d3.object.Ellipsoid, ray: ostk.mathematics.geometry.d3.object.Ray, only_in_sight: bool = False) -> ostk::mathematics::geometry::d3::Intersection
Get the intersection of the ellipsoid with a ray.
- Args:
ray (Ray): The ray to intersect with. only_in_sight (bool, optional): If true, only return intersection points that are in sight. Defaults to False.
- Returns:
Intersection: The intersection of the ellipsoid with the ray.
- Example:
>>> ellipsoid = Ellipsoid(center, 2.0, 1.5, 1.0) >>> ray = Ray(Point(0.0, 0.0, 0.0), Point(1.0, 0.0, 0.0)) >>> intersection = ellipsoid.intersection_with(ray) >>> intersection.get_point() # Point(0.0, 0.0, 0.0)
intersection_with(self: ostk.mathematics.geometry.d3.object.Ellipsoid, segment: ostk.mathematics.geometry.d3.object.Segment) -> ostk::mathematics::geometry::d3::Intersection
Get the intersection of the ellipsoid with a segment.
- Args:
segment (Segment): The segment to intersect with.
- Returns:
Intersection: The intersection of the ellipsoid with the segment.
- Example:
>>> ellipsoid = Ellipsoid(center, 2.0, 1.5, 1.0) >>> segment = Segment(Point(0.0, 0.0, 0.0), Point(1.0, 0.0, 0.0)) >>> intersection = ellipsoid.intersection_with(segment) >>> intersection.get_point() # Point(0.0, 0.0, 0.0)
intersection_with(self: ostk.mathematics.geometry.d3.object.Ellipsoid, pyramid: ostk::mathematics::geometry::d3::object::Pyramid, only_in_sight: bool = False) -> ostk::mathematics::geometry::d3::Intersection
Get the intersection of the ellipsoid with a pyramid.
- Args:
pyramid (Pyramid): The pyramid to intersect with. only_in_sight (bool, optional): If true, only return intersection points that are in sight. Defaults to False.
- Returns:
Intersection: The intersection of the ellipsoid with the pyramid.
- Example:
>>> origin = Point(0.0, 0.0, 0.0) >>> ellipsoid = Ellipsoid(origin, 2.0, 1.5, 1.0) >>> polygon2d = Polygon2d([Point2d(0.0, 0.0), Point2d(1.0, 0.0), Point2d(1.0, 1.0), Point2d(0.0, 1.0)]) >>> x_axis = numpy.array([1.0, 0.0, 0.0]) >>> y_axis = numpy.array([0.0, 1.0, 0.0]) >>> polygon = Polygon(polygon2d, origin, x_axis, y_axis) >>> pyramid = Pyramid(polygon, Point(0.0, 0.0, 1.0)) >>> intersection = ellipsoid.intersection_with(pyramid) >>> intersection.get_point()
intersection_with(self: ostk.mathematics.geometry.d3.object.Ellipsoid, cone: ostk::mathematics::geometry::d3::object::Cone, only_in_sight: bool = False) -> ostk::mathematics::geometry::d3::Intersection
Get the intersection of the ellipsoid with a cone.
- Args:
cone (Cone): The cone to intersect with. only_in_sight (bool, optional): If true, only return intersection points that are in sight. Defaults to False.
- Returns:
Intersection: The intersection of the ellipsoid with the cone.
- Example:
>>> ellipsoid = Ellipsoid(center, 2.0, 1.5, 1.0) >>> cone = Cone(Point(0.0, 0.0, 0.0), [1.0, 0.0, 0.0], Angle.degrees(30.0)) >>> intersection = ellipsoid.intersection_with(cone) >>> intersection.get_point()
- intersects(*args, **kwargs)¶
Overloaded function.
intersects(self: ostk.mathematics.geometry.d3.object.Ellipsoid, point: ostk.mathematics.geometry.d3.object.Point) -> bool
Check if the ellipsoid intersects a point.
- Args:
point (Point): The point to check.
- Returns:
bool: True if the ellipsoid intersects the point, False otherwise.
- Example:
>>> ellipsoid = Ellipsoid(Point(0.0, 0.0, 0.0), 2.0, 1.5, 1.0) >>> ellipsoid.intersects(Point(0.5, 0.5, 0.5)) # True
intersects(self: ostk.mathematics.geometry.d3.object.Ellipsoid, point_set: ostk.mathematics.geometry.d3.object.PointSet) -> bool
Check if the ellipsoid intersects a point set.
- Args:
point_set (PointSet): The point set to check.
- Returns:
bool: True if the ellipsoid intersects the point set, False otherwise.
- Example:
>>> ellipsoid = Ellipsoid(Point(0.0, 0.0, 0.0), 2.0, 1.5, 1.0) >>> ellipsoid.intersects(PointSet([Point(0.5, 0.5, 0.5), Point(1.0, 1.0, 1.0)])) # True
intersects(self: ostk.mathematics.geometry.d3.object.Ellipsoid, line: ostk.mathematics.geometry.d3.object.Line) -> bool
Check if the ellipsoid intersects a line.
- Args:
line (Line): The line to check.
- Returns:
bool: True if the ellipsoid intersects the line, False otherwise.
- Example:
>>> ellipsoid = Ellipsoid(Point(0.0, 0.0, 0.0), 2.0, 1.5, 1.0) >>> ellipsoid.intersects(Line.points(Point(0.5, 0.5, 0.5), Point(1.0, 1.0, 1.0))) # True
intersects(self: ostk.mathematics.geometry.d3.object.Ellipsoid, ray: ostk.mathematics.geometry.d3.object.Ray) -> bool
Check if the ellipsoid intersects a ray.
- Args:
ray (Ray): The ray to check.
- Returns:
bool: True if the ellipsoid intersects the ray, False otherwise.
- Example:
>>> ellipsoid = Ellipsoid(Point(0.0, 0.0, 0.0), 2.0, 1.5, 1.0) >>> ellipsoid.intersects(Ray(Point(0.5, 0.5, 0.5), [1.0, 0.0, 0.0])) # True
intersects(self: ostk.mathematics.geometry.d3.object.Ellipsoid, segment: ostk.mathematics.geometry.d3.object.Segment) -> bool
Check if the ellipsoid intersects a segment.
- Args:
segment (Segment): The segment to check.
- Returns:
bool: True if the ellipsoid intersects the segment, False otherwise.
- Example:
>>> ellipsoid = Ellipsoid(Point(0.0, 0.0, 0.0), 2.0, 1.5, 1.0) >>> ellipsoid.intersects(Segment(Point(0.5, 0.5, 0.5), Point(1.0, 1.0, 1.0))) # True
intersects(self: ostk.mathematics.geometry.d3.object.Ellipsoid, plane: ostk.mathematics.geometry.d3.object.Plane) -> bool
Check if the ellipsoid intersects a plane.
- Args:
plane (Plane): The plane to check.
- Returns:
bool: True if the ellipsoid intersects the plane, False otherwise.
- Example:
>>> ellipsoid = Ellipsoid(Point(0.0, 0.0, 0.0), 2.0, 1.5, 1.0) >>> ellipsoid.intersects(Plane(Point(0.5, 0.5, 0.5), Vector3d(1.0, 1.0, 1.0))) # True
- 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.Ellipsoid) bool ¶
Check if the ellipsoid is defined.
- Returns:
True if the ellipsoid is defined, False otherwise.
- Return type:
Example
>>> ellipsoid = Ellipsoid(center, 2.0, 1.5, 1.0) >>> ellipsoid.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.Ellipsoid ¶
Create an undefined ellipsoid.
- Returns:
An undefined ellipsoid object.
- Return type:
Example
>>> undefined_ellipsoid = Ellipsoid.undefined() >>> undefined_ellipsoid.is_defined() # False