Finds positions and surface normals where the sphere and the ray intersect.
tfg.geometry.representation.ray.intersection_ray_sphere( sphere_center, sphere_radius, ray, point_on_ray, name=None )
In the following, A1 to An are optional batch dimensions.
sphere_center: A tensor of shape
representing the 3d sphere center.
sphere_radius: A tensor of shape
containing a strictly positive value defining the radius of the sphere.
ray: A tensor of shape
[A1, ..., An, 3]containing normalized 3D vectors.
point_on_ray: A tensor of shape
[A1, ..., An, 3].
name: A name for this op. The default value of None means "ray_intersection_ray_sphere".
A tensor of shape
[2, A1, ..., An, 3] containing the position of the
intersections, and a tensor of shape
[2, A1, ..., An, 3] the associated
surface normals at that point. Both tensors contain NaNs when there is no
intersections. The first dimension of the returned tensor provides access to
the first and second intersections of the ray with the sphere.
ValueError: if the shape of
point_on_rayis not supported.
rayis not normalized.