ostk.mathematics.geometry.d3.object.Ellipsoid

class Ellipsoid(*args, **kwargs)

Bases: Object

Overloaded function.

  1. __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)
    
  2. __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_transformation

Apply a transformation to the ellipsoid in place.

as_cone

Convert the object to a cone.

as_ellipsoid

Convert the object to an ellipsoid.

as_line

Convert the object to a line.

as_line_string

Convert the object to a line string.

as_plane

Convert the object to a plane.

as_point

Convert the object to a point.

as_point_set

Convert the object to a point set.

as_polygon

Convert the object to a polygon.

as_pyramid

Convert the object to a pyramid.

as_ray

Convert the object to a ray.

as_segment

Convert the object to a segment.

as_sphere

Convert the object to a sphere.

contains

Overloaded function.

get_center

Get the center point of the ellipsoid.

get_first_axis

Get the first axis of the ellipsoid.

get_first_principal_semi_axis

Get the first principal semi-axis length.

get_matrix

Get the matrix of the ellipsoid.

get_orientation

Get the orientation quaternion of the ellipsoid.

get_second_axis

Get the second axis of the ellipsoid.

get_second_principal_semi_axis

Get the second principal semi-axis length.

get_third_axis

Get the third axis of the ellipsoid.

get_third_principal_semi_axis

Get the third principal semi-axis length.

intersection

Overloaded function.

intersection_with

Overloaded function.

intersects

Overloaded function.

is_cone

Check if the object is a cone.

is_defined

Check if the ellipsoid is defined.

is_ellipsoid

Check if the object is an ellipsoid.

is_line

Check if the object is a line.

is_line_string

Check if the object is a line string.

is_plane

Check if the object is a plane.

is_point

Check if the object is a point.

is_point_set

Check if the object is a point set.

is_polygon

Check if the object is a polygon.

is_pyramid

Check if the object is a pyramid.

is_ray

Check if the object is a ray.

is_segment

Check if the object is a segment.

is_sphere

Check if the object is a sphere.

undefined

Create an undefined ellipsoid.

apply_transformation(
self: ostk.mathematics.geometry.d3.object.Ellipsoid,
transformation: ostk::mathematics::geometry::d3::Transformation,
) None

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(
self: ostk.mathematics.geometry.d3.Object,
) ostk::mathematics::geometry::d3::object::Cone

Convert the object to a cone.

Returns:

The cone.

Return type:

Cone

as_ellipsoid(
self: ostk.mathematics.geometry.d3.Object,
) ostk::mathematics::geometry::d3::object::Ellipsoid

Convert the object to an ellipsoid.

Returns:

The ellipsoid.

Return type:

Ellipsoid

as_line(
self: ostk.mathematics.geometry.d3.Object,
) ostk::mathematics::geometry::d3::object::Line

Convert the object to a line.

Returns:

The line.

Return type:

Line

as_line_string(
self: ostk.mathematics.geometry.d3.Object,
) ostk::mathematics::geometry::d3::object::LineString

Convert the object to a line string.

Returns:

The line string.

Return type:

LineString

as_plane(
self: ostk.mathematics.geometry.d3.Object,
) ostk::mathematics::geometry::d3::object::Plane

Convert the object to a plane.

Returns:

The plane.

Return type:

Plane

as_point(
self: ostk.mathematics.geometry.d3.Object,
) ostk::mathematics::geometry::d3::object::Point

Convert the object to a point.

Returns:

The point.

Return type:

Point

as_point_set(
self: ostk.mathematics.geometry.d3.Object,
) ostk::mathematics::geometry::d3::object::PointSet

Convert the object to a point set.

Returns:

The point set.

Return type:

PointSet

as_polygon(
self: ostk.mathematics.geometry.d3.Object,
) ostk::mathematics::geometry::d3::object::Polygon

Convert the object to a polygon.

Returns:

The polygon.

Return type:

Polygon

as_pyramid(
self: ostk.mathematics.geometry.d3.Object,
) ostk::mathematics::geometry::d3::object::Pyramid

Convert the object to a pyramid.

Returns:

The pyramid.

Return type:

Pyramid

as_ray(
self: ostk.mathematics.geometry.d3.Object,
) ostk::mathematics::geometry::d3::object::Ray

Convert the object to a ray.

Returns:

The ray.

Return type:

Ray

as_segment(
self: ostk.mathematics.geometry.d3.Object,
) ostk::mathematics::geometry::d3::object::Segment

Convert the object to a segment.

Returns:

The segment.

Return type:

Segment

as_sphere(
self: ostk.mathematics.geometry.d3.Object,
) ostk::mathematics::geometry::d3::object::Sphere

Convert the object to a sphere.

Returns:

The sphere.

Return type:

Sphere

contains(*args, **kwargs)

Overloaded function.

  1. 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
    
  2. 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
    
  3. 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(
self: ostk.mathematics.geometry.d3.object.Ellipsoid,
) ostk.mathematics.geometry.d3.object.Point

Get the center point of the ellipsoid.

Returns:

The center point of the ellipsoid.

Return type:

Point

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(
self: ostk.mathematics.geometry.d3.object.Ellipsoid,
) 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(
self: ostk.mathematics.geometry.d3.object.Ellipsoid,
) ostk.core.type.Real

Get the first principal semi-axis length.

Returns:

The length of the first principal semi-axis.

Return type:

float

Example

>>> ellipsoid = Ellipsoid(center, 2.0, 1.5, 1.0)
>>> first_axis = ellipsoid.get_first_principal_semi_axis()  # 2.0
get_matrix(
self: ostk.mathematics.geometry.d3.object.Ellipsoid,
) 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(
self: ostk.mathematics.geometry.d3.object.Ellipsoid,
) ostk::mathematics::geometry::d3::transformation::rotation::Quaternion

Get the orientation quaternion of the ellipsoid.

Returns:

The orientation quaternion of the ellipsoid.

Return type:

Quaternion

Example

>>> ellipsoid = Ellipsoid(center, 2.0, 1.5, 1.0, orientation)
>>> quat = ellipsoid.get_orientation()
get_second_axis(
self: ostk.mathematics.geometry.d3.object.Ellipsoid,
) 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(
self: ostk.mathematics.geometry.d3.object.Ellipsoid,
) ostk.core.type.Real

Get the second principal semi-axis length.

Returns:

The length of the second principal semi-axis.

Return type:

float

Example

>>> ellipsoid = Ellipsoid(center, 2.0, 1.5, 1.0)
>>> second_axis = ellipsoid.get_second_principal_semi_axis()  # 1.5
get_third_axis(
self: ostk.mathematics.geometry.d3.object.Ellipsoid,
) 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(
self: ostk.mathematics.geometry.d3.object.Ellipsoid,
) ostk.core.type.Real

Get the third principal semi-axis length.

Returns:

The length of the third principal semi-axis.

Return type:

float

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.

  1. intersection(self: ostk.mathematics.geometry.d3.object.Ellipsoid, line: ostk.mathematics.geometry.d3.object.Line) -> ostk::mathematics::geometry::d3::Intersection

  2. intersection(self: ostk.mathematics.geometry.d3.object.Ellipsoid, ray: ostk.mathematics.geometry.d3.object.Ray, only_in_sight: bool) -> ostk::mathematics::geometry::d3::Intersection

  3. intersection(self: ostk.mathematics.geometry.d3.object.Ellipsoid, segment: ostk.mathematics.geometry.d3.object.Segment) -> ostk::mathematics::geometry::d3::Intersection

  4. intersection(self: ostk.mathematics.geometry.d3.object.Ellipsoid, pyramid: ostk::mathematics::geometry::d3::object::Pyramid, only_in_sight: bool) -> ostk::mathematics::geometry::d3::Intersection

  5. 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.

  1. 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)
    
  2. 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)
    
  3. 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)
    
  4. 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()
    
  5. 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.

  1. 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
    
  2. 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
    
  3. 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
    
  4. 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
    
  5. 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
    
  6. 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:

bool

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:

bool

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:

bool

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:

bool

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:

bool

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:

bool

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:

bool

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:

bool

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:

bool

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:

bool

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:

bool

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:

bool

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:

bool

static undefined() ostk.mathematics.geometry.d3.object.Ellipsoid

Create an undefined ellipsoid.

Returns:

An undefined ellipsoid object.

Return type:

Ellipsoid

Example

>>> undefined_ellipsoid = Ellipsoid.undefined()
>>> undefined_ellipsoid.is_defined()  # False