mt.geo3d.ellipsoid

There are many definitions of an ellipsoid. In our case, an ellipsoid is an affine transform of the unit sphere x^2+y^2+z^2=1.

Functions

mt.geo3d.ellipsoid.transform_Aff3d_on_Ellipsoid(aff_tfm, obj)

Affine-transforms an Ellipsoid. The resultant Ellipsoid has affine transformation aff_tfm*obj.aff_tfm.

Parameters:
  • aff_tfm (Aff3d) – an affine transformation

  • obj (Ellipsoid) – an ellipsoid

Returns:

the affine-transformed ellipsoid

Return type:

Ellipsoid

Classes

  • Ellipsoid: Ellipsoid, defined as an affine transform the unit sphere x^2+y^2+z^2=1.

class mt.geo3d.ellipsoid.Ellipsoid(aff_tfm, make_normalised=True)

Ellipsoid, defined as an affine transform the unit sphere x^2+y^2+z^2=1.

If the unit sphere is parameterised by (cos(t_1), sin(t_1)*cos(t_2), sin(t_1)*sin(t_2)) where t_1 in [0,pi) and t_2 in [0,2pi) then the ellipsoid is parameterised by f0 + f1 cos(t_1) + f2 sin(t_1) cos(t_2) + f3 sin(t_1) sin(t_2), where f0 is the bias vector, f1, f2, f3 are the columns of the weight matrix from left to right respectively, of the affine transformation. They are also called called axes of the ellipsoid.

Note that this representation is not unique, the same ellipsoid can be represented by an infinite number of affine transforms of the unit sphere. To make the representation more useful we further assert that when the axes are perpendicular (linearly independent), the ellipsoid is normalised. In other words, the weight matrix is a unitary matrix multiplied by a diagonal matrix. After normalisation there is almost surely a finite number of ways to represent the same ellipsoid, except for singular cases. You can normalise either at initialisation time, or later by invoking member function normalised.

Parameters:
  • aff_tfm (Aff3d) – a 3D affine transformation

  • make_normalised (bool) – whether or not to adjust the affine transformation to make a normalised representation of the ellipsoid

Examples

>>> import numpy as np
>>> from mt.geo3d import Aff3d, Ellipsoid
>>> a = Aff3d(bias=np.array([2,3]), weight=np.diag([4,5]))
>>> e = Ellipsoid(a)
>>> e
Ellipsoid(aff_tfm=Aff3d(weight_diagonal=[0. 0.], bias=[2 3]))
>>> e.aff_tfm.matrix
array([[0., 4., 2.],
       [5., 0., 3.],
       [0., 0., 1.]])

Inheritance

digraph inheritance0d1f1ecb31 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "Ellipsoid" [URL="#mt.geo3d.ellipsoid.Ellipsoid",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Ellipsoid, defined as an affine transform the unit sphere x^2+y^2+z^2=1."]; "ThreeD" -> "Ellipsoid" [arrowsize=0.5,style="setlinewidth(0.5)"]; "GeometricObject" -> "Ellipsoid" [arrowsize=0.5,style="setlinewidth(0.5)"]; "GeometricObject" [URL="../mt.geo/mt.geo.object.html#mt.geo.object.GeometricObject",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A geometric object which lives in a d-dimensional Euclidean space."]; "ThreeD" [URL="../mt.geo/mt.geo.object.html#mt.geo.object.ThreeD",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Mixin to assert that the geometric object lives in 3D Euclidean space."]; }
__init__(aff_tfm, make_normalised=True)

Initialises an ellipsoid with an affine transformation.

__repr__()

Return repr(self).

normalised()

Returns an equivalent ellipsoid where f1, f2 and f3 are perpendicular (linearly independent).

property surface_area

The surface area of the ellipsoid.

property volume

The absolute volume of the ellipsoid’s interior.