Package pygeodesy :: Module ellipses :: Class Ellipse
[frames] | no frames]

Class Ellipse

  object --+        
           |        
named._Named --+    
               |    
named._NamedBase --+
                   |
                  Ellipse

Class to compute various attributes of a 2-D ellipse.

Instance Methods
 
__init__(self, a, b, **name)
New Ellipse with semi-axes a and b.
 
arc(self, deg2, deg1=0)
Compute the length of elliptic arc (deg2 - deg1), both counter-clockwise from semi-axis a to b of the ellipse.
 
arc_(self, rad2, rad1=0)
Compute the length of elliptic arc (rad2 - rad1), both counter-clockwise from semi-axis a to b of the ellipse.
 
hartzell4(self, x, y, los=False)
Compute the intersection of this ellipse with a Line-Of-Sight from Point-Of-View (x, y) outside this ellipse.
 
height4(self, x, y, **normal_eps)
Compute the projection on and distance to this ellipse from a point (x, y) in- or outside this ellipse.
 
normal3d(self, deg_x, y=None, **length)
Get a 3-D vector perpendicular to this ellipse from point (x, y) on this ellipse or at deg degrees along this ellipse.
 
normal4(self, deg_x, y=None, **height_normal)
Compute a point at height above or below this ellipse point (x, y) on this ellipse or at deg degrees along this ellipse.
 
Roc(self, deg_x, y=None, **eps)
Compute the radius of curvature at point (x, y) on this ellipse or at deg degrees along this ellipse.
 
Roc_(self, rad_x, y=None, **eps)
Compute the radius of curvature at point (x, y) on this ellipse or at rad radians along this ellipse.
 
sideOf(self, x, y, eps=2.220446049250313e-16)
Return a positive, negative or 0 fraction if point (x, y) is outside, inside respectively on this ellipse.
 
slope(self, deg_x, y=None, **eps)
Compute the slope of the tangent at point (x, y) on this ellipse or at deg degrees along this ellipse.
 
slope_(self, rad_x, y=None, **eps)
Compute the slope of the tangent at point (x, y) on this ellipse or at rad radians along this ellipse.
 
toEllipsoid(self)
Return an Ellipsoid from this ellipse' a and b semi-axes.
 
toStr(self, prec=8, terse=2, **sep_name)
Return this ellipse as a text string.
 
toTriaxial_(self, c=2.220446049250313e-16)
Return a Triaxial_ from this ellipse' a and b semi-axes with c as minor semi-axis.

Inherited from named._NamedBase: __repr__, __str__, others, toRepr

Inherited from named._Named: __format__, __imatmul__, __matmul__, __rmatmul__, attrs, classof, copy, dup, methodname, rename, renamed, toStr2

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Properties
  a
Get semi-axis a of this ellipse (meter, conventionally).
  area
Get the area of this ellipse (meter**2, conventionally).
  b
Get semi-axis b of this ellipse (meter, conventionally).
  c
Get the linear excentricity c, unsigned (meter, conventionally).
  e
Get the excentricity (scalar, 0 <= e <= 1).
  e2
Get the excentricity squared (scalar, 0 <= e2 <= 1).
  foci
Get the linear excentricity, signed (meter, conventionally), positive if this ellipse is oblate, negative if prolate or 0 if circular.
  isCircular
Is this ellipse circular? (bool)
  isFlat
Is this ellipse "flat", too pro-/oblate? (bool)
  isOblate
Is this ellipse oblate (foci on semi-axis a)? (bool)
  isProlate
Is this ellipse prolate (foci on semi-axis b)? (bool)
  lati
Get the semi-latus rectum, signed (meter, conventionally), positive if this ellipse is oblate or circular, 0 if "flat" and oblate, negative if prolate or NEG0 if "flat" and prolate.
  p
Get the semi-latus rectum p (aka 𝓁, script-small-l), unsigned (meter, conventionally).
  perimeterAGM
Compute the perimeter of this ellipse using the Arithmetic-Geometric Mean formula (meter, conventionally).
  perimeter4Arc3
Compute the perimeter (and arcs) of this ellipse using the 4-Arc approximation as a 3-Tuple (P, Ra, Rb) with perimeter P, arc radii Ra and Rb at the respective semi-axes (all in meter, conventionally).
  perimeterGK
Compute the perimeter of this ellipse using the Gauss-Kummer series, b / a > 0.75 (meter, conventionally).
  perimeter2k
Compute the perimeter of this ellipse using the complete integral of the 2nd kind, Elliptic.cE (meter, conventionally).
  perimeter2k_
Compute the perimeter of this ellipse using SciPy's ellipe function if available, otherwise use property perimeter2k (meter, conventionally).
  perimeterHGK
Compute the perimeter of this ellipse using the Hypergeometric Gauss-Kummer series (meter, conventionally).
  perimeter2R
Compute the perimeter of this ellipse using Ramanujan's 2nd approximation, b / a > 0.9 (meter, conventionally).
  R2
Get the authalic radius of this ellipse, sqrt(a * b) (meter, conventionally).

Inherited from named._Named: classname, classnaming, iteration, name, named, named2, named3, named4, sizeof, typename

Inherited from object: __class__

Method Details

__init__ (self, a, b, **name)
(Constructor)

 

New Ellipse with semi-axes a and b.

The ellipse is oblate if a > b, prolate if a < b, circular if a == b and "flat" if min(a, b) <<< max(a, b).

Arguments:
  • a - X semi-axis length (meter, conventionally).
  • b - Y semi-axis length (meter, conventionally).
Raises:
  • ValueError - Invalid a or b.
Overrides: object.__init__

arc (self, deg2, deg1=0)

 

Compute the length of elliptic arc (deg2 - deg1), both counter-clockwise from semi-axis a to b of the ellipse.

Arguments:
  • deg2 - End angle of the elliptic arc (degrees).
  • deg1 - Start angle of the elliptic arc (degrees).
Returns:
Arc length, signed (meter, conventionally).

arc_ (self, rad2, rad1=0)

 

Compute the length of elliptic arc (rad2 - rad1), both counter-clockwise from semi-axis a to b of the ellipse.

Arguments:
  • rad2 - End angle of the elliptic arc (radians).
  • rad1 - Start angle of the elliptic arc (radians).
Returns:
Arc length, signed (meter, conventionally).

hartzell4 (self, x, y, los=False)

 

Compute the intersection of this ellipse with a Line-Of-Sight from Point-Of-View (x, y) outside this ellipse.

Arguments:
  • los - Line-Of-Sight, direction to the ellipse (Los, Vector3d, Vector2Tuple or 2-tuple (dx, dy)) or True for the normal, perpendicular, plumb to this ellipse or False or None to point to its center.
Returns:
Vector4Tuple(x, y, z, h) with coordinates x, y and z=0 of the intersection and h the distance to "Point-Of-View" (x, y) along the los, all in meter, conventionally.
Raises:
  • EllipseError - Invalid x, y or los or los points outside or away from this ellipse.

See Also: Function hartzell4 for further details.

height4 (self, x, y, **normal_eps)

 

Compute the projection on and distance to this ellipse from a point (x, y) in- or outside this ellipse.

Arguments:
  • normal_eps - With default normal=True the projection is perpendicular, plumb to this ellipse, otherwise radially to its center (bool). Tolerance eps=EPS for root finding and validation (scalar), use a negative value to skip validation.
Returns:
Vector4Tuple(x, y, z, h) with coordinates x, y and z=0 of the projection on or the intersection with the ellipse and h the signed, normal distance to the ellipse in meter, conventionally. Positive h indicates, x and/or y are outside the ellipse, negative h means inside.
Raises:
  • EllipseError - Invalid x, y or eps, no convergence in root finding or validation failed.

See Also: Methods Ellipse.normal3d, Ellipse.normal4 and function height4.

normal3d (self, deg_x, y=None, **length)

 

Get a 3-D vector perpendicular to this ellipse from point (x, y) on this ellipse or at deg degrees along this ellipse.

Arguments:
  • length - Optional, signed length=1 in out-/inward direction (scalar).
Returns:
A Vector3d(x_, y_, z_=0) normalized to length, pointing out- or inward for postive respectively negative length.
Raises:

See Also: Methods Ellipse.height4, Ellipse.normal4, Ellipse.sideOf and Triaxial_.normal3d.

normal4 (self, deg_x, y=None, **height_normal)

 

Compute a point at height above or below this ellipse point (x, y) on this ellipse or at deg degrees along this ellipse.

Arguments:
  • height_normal - The desired distance height=0 in- or outside this ellipse (meter, conventionally) and normal=True, If normal=True, the height is perpendicular, plumb to this ellipse, otherwise radially to its center (bool).
Returns:
Vector4Tuple(x, y, z, h) with coordinates x, y and z=0 and h the signed, normal distance to the ellipse in meter, conventionally. Positive h indicates, x and/or y are outside the ellipse, negative h means inside.
Raises:

See Also: Methods Ellipse.height4, Ellipse.normal3d, Ellipse.sideOf and Triaxial_.normal4.

Roc (self, deg_x, y=None, **eps)

 

Compute the radius of curvature at point (x, y) on this ellipse or at deg degrees along this ellipse.

See Also: Method Roc_ for ruther details.

Roc_ (self, rad_x, y=None, **eps)

 

Compute the radius of curvature at point (x, y) on this ellipse or at rad radians along this ellipse.

Arguments:
  • eps - See method sideOf, use eps=0 to permit any points.
Returns:
Curvature (meter, conventionally).
Raises:
  • ValueError - Point (x, y) not near this ellipse, unless eps=0.

slope (self, deg_x, y=None, **eps)

 

Compute the slope of the tangent at point (x, y) on this ellipse or at deg degrees along this ellipse.

See Also: Method slope_ for ruther details.

slope_ (self, rad_x, y=None, **eps)

 

Compute the slope of the tangent at point (x, y) on this ellipse or at rad radians along this ellipse.

Arguments:
  • eps - See method sideOf, use eps=0 to permit any points.
Returns:
Slope (radians), negative for 0 <= rad < PI/2.
Raises:
  • ValueError - (x, y) not near this ellipse, unless eps=0.

toStr (self, prec=8, terse=2, **sep_name)

 

Return this ellipse as a text string.

Arguments:
  • prec - Number of decimal digits, unstripped (int).
  • terse - Limit the number of items (int, 0...9), use terse=0 or =None for all.
  • sep_name - Optional name=NN (str) or None to exclude this ellipse' name and separator sep=", " to join the items (str).
Returns:
This Ellipse' attributes (str).
Overrides: named._Named.toStr

Property Details

a

Get semi-axis a of this ellipse (meter, conventionally).

Get method:
a(self) - Get semi-axis a of this ellipse (meter, conventionally).
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

area

Get the area of this ellipse (meter**2, conventionally).

Get method:
area(self) - Get the area of this ellipse (meter**2, conventionally).
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

b

Get semi-axis b of this ellipse (meter, conventionally).

Get method:
b(self) - Get semi-axis b of this ellipse (meter, conventionally).
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

c

Get the linear excentricity c, unsigned (meter, conventionally).

Get method:
c(self) - Get the linear excentricity c, unsigned (meter, conventionally).
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

e

Get the excentricity (scalar, 0 <= e <= 1).

Get method:
e(self) - Get the excentricity (scalar, 0 <= e <= 1).
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

e2

Get the excentricity squared (scalar, 0 <= e2 <= 1).

Get method:
e2(self) - Get the excentricity squared (scalar, 0 <= e2 <= 1).
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

foci

Get the linear excentricity, signed (meter, conventionally), positive if this ellipse is oblate, negative if prolate or 0 if circular. See also property Ellipse.c.

Get method:
foci(self) - Get the linear excentricity, signed (meter, conventionally), positive if this ellipse is oblate, negative if prolate or 0 if circular.
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

isCircular

Is this ellipse circular? (bool)

Get method:
isCircular(self) - Is this ellipse circular? (bool)
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

isFlat

Is this ellipse "flat", too pro-/oblate? (bool)

Get method:
isFlat(self) - Is this ellipse "flat", too pro-/oblate? (bool)
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

isOblate

Is this ellipse oblate (foci on semi-axis a)? (bool)

Get method:
isOblate(self) - Is this ellipse oblate (foci on semi-axis a)? (bool)
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

isProlate

Is this ellipse prolate (foci on semi-axis b)? (bool)

Get method:
isProlate(self) - Is this ellipse prolate (foci on semi-axis b)? (bool)
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

lati

Get the semi-latus rectum, signed (meter, conventionally), positive if this ellipse is oblate or circular, 0 if "flat" and oblate, negative if prolate or NEG0 if "flat" and prolate. See also property Ellipse.p.

Get method:
lati(self) - Get the semi-latus rectum, signed (meter, conventionally), positive if this ellipse is oblate or circular, 0 if "flat" and oblate, negative if prolate or NEG0 if "flat" and prolate.
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

p

Get the semi-latus rectum p (aka 𝓁, script-small-l), unsigned (meter, conventionally).

Get method:
p(self) - Get the semi-latus rectum p (aka 𝓁, script-small-l), unsigned (meter, conventionally).
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

perimeterAGM

Compute the perimeter of this ellipse using the Arithmetic-Geometric Mean formula (meter, conventionally).

Get method:
perimeterAGM(self) - Compute the perimeter of this ellipse using the Arithmetic-Geometric Mean formula (meter, conventionally).
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

perimeter4Arc3

Compute the perimeter (and arcs) of this ellipse using the 4-Arc approximation as a 3-Tuple (P, Ra, Rb) with perimeter P, arc radii Ra and Rb at the respective semi-axes (all in meter, conventionally).

Get method:
perimeter4Arc3(self) - Compute the perimeter (and arcs) of this ellipse using the 4-Arc approximation as a 3-Tuple (P, Ra, Rb) with perimeter P, arc radii Ra and Rb at the respective semi-axes (all in meter, conventionally).
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

perimeterGK

Compute the perimeter of this ellipse using the Gauss-Kummer series, b / a > 0.75 (meter, conventionally).

Get method:
perimeterGK(self) - Compute the perimeter of this ellipse using the Gauss-Kummer series, b / a > 0.75 (meter, conventionally).
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

perimeter2k

Compute the perimeter of this ellipse using the complete integral of the 2nd kind, Elliptic.cE (meter, conventionally).

Get method:
perimeter2k(self) - Compute the perimeter of this ellipse using the complete integral of the 2nd kind, Elliptic.cE (meter, conventionally).
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

perimeter2k_

Compute the perimeter of this ellipse using SciPy's ellipe function if available, otherwise use property perimeter2k (meter, conventionally).

Get method:
perimeter2k_(self) - Compute the perimeter of this ellipse using SciPy's ellipe function if available, otherwise use property perimeter2k (meter, conventionally).
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

perimeterHGK

Compute the perimeter of this ellipse using the Hypergeometric Gauss-Kummer series (meter, conventionally).

Get method:
perimeterHGK(self) - Compute the perimeter of this ellipse using the Hypergeometric Gauss-Kummer series (meter, conventionally).
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

perimeter2R

Compute the perimeter of this ellipse using Ramanujan's 2nd approximation, b / a > 0.9 (meter, conventionally).

Get method:
perimeter2R(self) - Compute the perimeter of this ellipse using Ramanujan's 2nd approximation, b / a > 0.9 (meter, conventionally).
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

R2

Get the authalic radius of this ellipse, sqrt(a * b) (meter, conventionally).

Get method:
R2(self) - Get the authalic radius of this ellipse, sqrt(a * b) (meter, conventionally).
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.