Ellipsoid.compute_normals

giant.ray_tracer.shapes.ellipsoid:

Ellipsoid.compute_normals(self, locs)

This method computes the local surface normal for a location on the surface of the ellipsoid.

The input should be the body centered vectors in the current frame (that is the vector from the center of the body to a point on the surface).

This method does not check that the point is on the surface, so if you provide a point that is not on the surface of the ellipsoid you will get undefined results.

The surface normal vector for any point on the surface of a triaxial ellipsoid is defined as:

\[\mathbf{n} = \mathbf{A}_C\mathbf{x}_C\]

where \(\mathbf{x}_C\) are the centered points in the current frame. These are then converted to unit normal vectors.

Typically a user won’t directly use this method and instead will use the methods compute_intersect() or trace() to trace rays and get the normal vector at the intersect location.

Parameters:

locs (np.ndarray) – The centered surface locations as a 3xn array, where each column corresponds to a surface location

Returns:

The unit normal vectors as a 3xn array

Return type:

np.ndarray