Geometry

class marxs.math.geometry.Geometry(kwargs={})[source] [edit on github]

Bases: NoGeometry

Attributes Summary

n_points

Methods Summary

get_local_euklid_bases(interpos_local)

Obtain a local eukledian base at a set of positions.

intersect(dir, pos)

Calculate the intersection point between a ray and the element

Attributes Documentation

n_points = 50

Methods Documentation

get_local_euklid_bases(interpos_local)[source] [edit on github]

Obtain a local eukledian base at a set of positions.

Parameters:
interpos_localnumpy.ndarray of shape (N, 2)

coordinates in the coordiante system of the geometry (e.g. (x, y), or (r, phi)).

Returns:
e_1, e_2, nnumpy.ndarray of shape (N, 4)

Vectors pointing in direction 1, 2, and normal to the surface.

intersect(dir, pos)[source] [edit on github]

Calculate the intersection point between a ray and the element

Parameters:
dirnumpy.ndarray of shape (N, 4)

homogeneous coordinates of the direction of the ray

posnumpy.ndarray of shape (N, 4)

homogeneous coordinates of a point on the ray

Returns:
intersectboolean array of length N

True if an intersection point is found.

interposnumpy.ndarray of shape (N, 4)

homogeneous coordinates of the intersection point. Values are set to np.nan if no intersection point is found.

interpos_localnumpy.ndarray of shape (N, 2)

y and z coordinates in the coordiante system of the active plane.