Skip to content

Commit

Permalink
Fix math and description of coordinates
Browse files Browse the repository at this point in the history
  • Loading branch information
f-brinkmann committed Apr 26, 2024
1 parent 88dcccd commit d7c144d
Showing 1 changed file with 41 additions and 35 deletions.
76 changes: 41 additions & 35 deletions pyfar/classes/coordinates.py
Expand Up @@ -1120,7 +1120,7 @@ def cylindrical(self, value):
def x(self):
r"""
X coordinate of a right handed Cartesian coordinate system in meters
(-\infty < x < \infty)."""
(:math:`-\infty` < x < :math:`\infty`)."""
self._check_empty()
return self._x

Expand All @@ -1132,7 +1132,7 @@ def x(self, value):
def y(self):
r"""
Y coordinate of a right handed Cartesian coordinate system in meters
(-\infty < y < \infty)."""
(:math:`-\infty` < y < :math:`\infty`)."""
self._check_empty()
return self._y

Expand All @@ -1144,7 +1144,7 @@ def y(self, value):
def z(self):
r"""
Z coordinate of a right handed Cartesian coordinate system in meters
(-\infty < z < \infty)."""
(:math:`-\infty` < z < :math:`\infty`)."""
self._check_empty()
return self._z

Expand All @@ -1155,8 +1155,8 @@ def z(self, value):
@property
def rho(self):
r"""
Radial distance to the the z-axis of the right handed
Cartesian coordinate system in meters (0 \leq radius < \infty)."""
Distance perpendicular to the the z-axis of the right handed Cartesian
coordinate system (:math:`0` < rho < :math:`\infty`)."""
return self.cylindrical[..., 2]

@rho.setter
Expand All @@ -1168,8 +1168,8 @@ def rho(self, rho):
@property
def radius(self):
r"""
Radial distance to the origin of the coordinate
system in meters (0 \leq radius < \infty)."""
Distance to the origin of the right handed Cartesian coordinate system
in meters (:math:`0` < radius < :math:`\infty`)."""
return np.sqrt(self.x**2 + self.y**2 + self.z**2)

@radius.setter
Expand All @@ -1181,10 +1181,10 @@ def radius(self, radius):
@property
def azimuth(self):
r"""
Counter clock-wise angle in the x-y plane of the right handed
Cartesian coordinate system in radians. 0 radians are defined in
positive x-direction, pi/2 radians in positive y-direction and so on
(-\infty < azimuth < \infty, 2pi-cyclic)."""
Counter clock-wise angle in the x-y plane of the right handed Cartesian
coordinate system in radians. :math:`0` radians are defined in positive
x-direction, :math:`\pi/2` radians in positive y-direction and so on
(:math:`-\infty` < azimuth < :math:`\infty`, :math:`2\pi`-cyclic)."""
return self.spherical_colatitude[..., 0]

@azimuth.setter
Expand All @@ -1196,10 +1196,11 @@ def azimuth(self, azimuth):
@property
def elevation(self):
r"""
Angle in the x-z plane of the right handed Cartesian coordinate
system in radians. 0 radians elevation are defined in positive
x-direction, pi/2 radians in positive z-direction, and -pi/2 in
negative z-direction (0 \leq azimuth \leq pi). The elevation is a
Angle in the x-z plane of the right handed Cartesian coordinate system
in radians. :math:`0` radians elevation are defined in positive
x-direction, :math:`\pi/2` radians in positive z-direction, and
:math:`-\pi/2` in negative z-direction
(:math:`-\pi/2\leq` elevation :math:`\leq\pi/2`). The elevation is a
variation of the colatitude."""
return self.spherical_elevation[..., 1]

Expand All @@ -1212,10 +1213,11 @@ def elevation(self, elevation):
@property
def colatitude(self):
r"""
Angle in the x-z plane of the right handed Cartesian coordinate
system in radians. 0 radians elevation are defined in positive
z-direction, pi/2 radians in positive x-direction, and pi in negative
z-direction (pi/2 \leq azimuth \leq pi/2). The colatitude is a
Angle in the x-z plane of the right handed Cartesian coordinate system
in radians. :math:`0` radians colatitude are defined in positive
z-direction, :math:`\pi/2` radians in positive x-direction, and
:math:`\pi` in negative z-direction
(:math:`0\leq` colatitude :math:`\leq\pi`). The colatitude is a
variation of the elevation angle."""
return self.spherical_colatitude[..., 1]

Expand All @@ -1228,10 +1230,11 @@ def colatitude(self, colatitude):
@property
def frontal(self):
r"""
Angle in the y-z plane of the right handed Cartesian coordinate
system in radians. 0 radians elevation are defined in positive
y-direction, pi/2 radians in positive z-direction, pi in negative
y-direction and so on (-\infty < azimuth < \infty, 2pi-cyclic)."""
Angle in the y-z plane of the right handed Cartesian coordinate system
in radians. :math:`0` radians frontal angle are defined in positive
y-direction, :math:`\pi/2` radians in positive z-direction,
:math:`\pi` in negative y-direction and so on
(:math:`-\infty` < frontal < :math:`\infty`, :math:`2\pi`-cyclic)."""
return self.spherical_front[..., 0]

@frontal.setter
Expand All @@ -1243,10 +1246,11 @@ def frontal(self, frontal):
@property
def upper(self):
r"""
Angle in the x-z plane of the right handed Cartesian coordinate
system in radians. 0 radians elevation are defined in positive
x-direction, pi/2 radians in positive z-direction, and pi in negative
x-direction (0 \leq azimuth \leq pi)."""
Angle in the x-z plane of the right handed Cartesian coordinate system
in radians. :math:`0` radians upper angle are defined in positive
x-direction, :math:`\pi/2` radians in positive z-direction, and
:math:`\pi` in negative x-direction
(:math:`0\leq` upper :math:`\leq\pi`)."""
return self.spherical_front[..., 1]

@upper.setter
Expand All @@ -1258,10 +1262,11 @@ def upper(self, upper):
@property
def lateral(self):
r"""
Counter clock-wise angle in the x-y plane of the right handed
Cartesian coordinate system in radians. 0 radians are defined in
positive x-direction, pi/2 radians in positive y-direction and -pi/2
in negative y-direction (-pi/2 \leq lateral \leq pi/2)."""
Counter clock-wise angle in the x-y plane of the right handed Cartesian
coordinate system in radians. :math:`0` radians are defined in positive
x-direction, :math:`\pi/2` radians in positive y-direction and
:math:`-\pi/2` in negative y-direction
(:math:`-\pi/2\leq` lateral :math:`\leq\pi/2`)."""
return self.spherical_side[..., 0]

@lateral.setter
Expand All @@ -1273,10 +1278,11 @@ def lateral(self, lateral):
@property
def polar(self):
r"""
Angle in the x-z plane of the right handed Cartesian coordinate
system in radians. 0 radians elevation are defined in positive
x-direction, pi/2 radians in positive z-direction, pi in negative
x-direction and so on (-\infty < azimuth < \infty, 2pi-cyclic)."""
Angle in the x-z plane of the right handed Cartesian coordinate system
in radians. :math:`0` radians polar angle are defined in positive
x-direction, :math:`\pi/2` radians in positive z-direction,
:math:`\pi` in negative x-direction and so on
(:math:`-\infty` < polar < :math:`\infty`, :math:`2\pi`-cyclic)."""
return self.spherical_side[..., 1]

@polar.setter
Expand Down

0 comments on commit d7c144d

Please sign in to comment.