legume.Poly

class legume.Poly(eps=1.0, x_edges=[0.0], y_edges=[0.0])

Polygon shape

__init__(eps=1.0, x_edges=[0.0], y_edges=[0.0])

Create a polygon shape

Parameters:
  • eps (float) – Permittivity value
  • x_edges (List or np.ndarray) – x-coordinates of polygon vertices
  • y_edges (List or np.ndarray) – y-coordinates of polygon vertices

Note

The polygon vertices must be supplied in counter-clockwise order.

Methods

__init__([eps, x_edges, y_edges]) Create a polygon shape
compute_ft(gvec) Compute Fourier transform of the polygon
is_inside(x, y) Elementwise indicator function for the shape
rotate(angle) Rotate the polygon around its center of mass by angle radians