def intrinsic_to_extrinsic_coords(point_intrinsic): """Convert point from intrinsic to extrensic coordinates. Convert the parameterization of a point in the hyperbolic space from its intrinsic coordinates, to its extrinsic coordinates in Minkowski space. Parameters ---------- point_intrinsic : array-like, shape=[..., n_disk, dim] Point in intrinsic coordinates. Returns ------- point_extrinsic : array-like, shape=[..., n_disks, dim + 1] Point in extrinsic coordinates. """ n_disks = point_intrinsic.shape[1] point_extrinsic = gs.stack( [ _Hyperbolic.change_coordinates_system( point_intrinsic[:, i_disk, ...], "intrinsic", "extrinsic") for i_disk in range(n_disks) ], axis=1, ) return point_extrinsic
def intrinsic_to_extrinsic_coords(self, point_intrinsic): """Convert from intrinsic to extrinsic coordinates. Parameters ---------- point_intrinsic : array-like, shape=[..., dim] Point in the embedded manifold in intrinsic coordinates. Returns ------- point_extrinsic : array-like, shape=[..., dim + 1] Point in the embedded manifold in extrinsic coordinates. """ if self.dim != point_intrinsic.shape[-1]: raise NameError("Wrong intrinsic dimension: " + str(point_intrinsic.shape[-1]) + " instead of " + str(self.dim)) return _Hyperbolic.change_coordinates_system(point_intrinsic, "intrinsic", "extrinsic")
def extrinsic_to_intrinsic_coords(self, point_extrinsic): """Convert from extrinsic to intrinsic coordinates. Parameters ---------- point_extrinsic : array-like, shape=[..., dim + 1] Point in the embedded manifold in extrinsic coordinates, i. e. in the coordinates of the embedding manifold. Returns ------- point_intrinsic : array-like, shape=[..., dim] Point in intrinsic coordinates. """ belong_point = self.belongs(point_extrinsic) if not gs.all(belong_point): raise NameError("Point that does not belong to the hyperboloid " "found") return _Hyperbolic.change_coordinates_system(point_extrinsic, "extrinsic", "intrinsic")