1- """Compute the angular midpoints between two angular coordinates in different geometric spaces"""
1+ """Compute the angular midpoints between two angular coordinates in different geometric spaces. """
22
33from __future__ import annotations
44
99
1010
1111def hyperbolic_midpoint (u : float , v : float , assert_hyperbolic : bool = False ) -> Float [torch .Tensor , "" ]:
12- """
13- Compute the hyperbolic midpoint between two angular coordinates u and v.
12+ """Compute the hyperbolic midpoint between two angular coordinates u and v.
1413
1514 Args:
1615 u: The first angular coordinate.
@@ -31,8 +30,7 @@ def hyperbolic_midpoint(u: float, v: float, assert_hyperbolic: bool = False) ->
3130
3231
3332def is_hyperbolic_midpoint (u : float , v : float , m : float ) -> bool :
34- """
35- Verifies if m is the true hyperbolic midpoint between u and v.
33+ r"""Verify if $\mathbf{m}$ is the true hyperbolic midpoint between $\mathbf{u}$ and $\mathbf{v}$.
3634
3735 Args:
3836 u (torch.Tensor): The first angular coordinate.
@@ -48,8 +46,7 @@ def is_hyperbolic_midpoint(u: float, v: float, m: float) -> bool:
4846
4947
5048def spherical_midpoint (u : float , v : float ) -> Float [torch .Tensor , "" ]:
51- """
52- Compute the spherical midpoint between two angular coordinates u and v.
49+ """Compute the spherical midpoint between two angular coordinates u and v.
5350
5451 Args:
5552 u (torch.Tensor): The first angular coordinate.
@@ -62,24 +59,20 @@ def spherical_midpoint(u: float, v: float) -> Float[torch.Tensor, ""]:
6259
6360
6461def euclidean_midpoint (u : float , v : float ) -> Float [torch .Tensor , "" ]:
65- """
66- Compute the euclidean midpoint between two angular coordinates u and v.
62+ """Compute the euclidean midpoint between two angular coordinates u and v.
6763
6864 Args:
6965 u (torch.Tensor): The first angular coordinate.
7066 v (torch.Tensor): The second angular coordinate.
7167
7268 Returns:
73- torch.Tensor: The computed spherical midpoint between u and v.
69+ torch.Tensor: The computed euclidean midpoint between u and v.
7470 """
7571 return torch .arctan2 (torch .tensor (2.0 ), (1.0 / torch .tan (u ) + 1.0 / torch .tan (v )))
7672
7773
7874def midpoint (
79- u : Float [torch .Tensor , "" ],
80- v : Float [torch .Tensor , "" ],
81- manifold : Manifold ,
82- special_first : bool = False ,
75+ u : Float [torch .Tensor , "" ], v : Float [torch .Tensor , "" ], manifold : Manifold , special_first : bool = False
8376) -> Float [torch .Tensor , "" ]:
8477 """Compute the midpoint between two angular coordinates given the manifold type.
8578
0 commit comments