MCPcopy
hub / github.com/PiLiDAR/PiLiDAR / angular_from_cartesian

Function angular_from_cartesian

lib/pointcloud.py:560–565  ·  view source on GitHub ↗
(cartesian_points)

Source from the content-addressed store, hash-verified

558# pointcloud Lookup
559
560def angular_from_cartesian(cartesian_points):
561 r = np.sqrt(np.sum(cartesian_points**2, axis=1)) + 1e-10 # hack: avoid division by zero
562 theta = np.arccos(cartesian_points[:, 2] / r)
563 phi = np.arctan2(cartesian_points[:, 1], cartesian_points[:, 0])
564 angular_points = np.stack([theta, r, phi], axis=1)
565 return angular_points
566
567def get_sampling_coordinates(angular_points, img_shape, z_rotate=0):
568 image_height, image_width = img_shape

Callers 2

postprocess_3DFunction · 0.85
get_lidar_panoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected