jax_sbgeom.coils.discrete_coil module¶
- class DiscreteCoil(positions: Array, _centre_i: Array)[source]¶
Bases:
CoilClass representing a coil defined by discrete positions and a centre. This centre is precomputed from the given positions. It does not feature in the computation of the coil positions; only the centre.
- positions: Array¶
- classmethod from_positions(positions: Array)[source]¶
Create a DiscreteCoil from discrete positions
Positions are assumed to be non-periodic (in other words, the first and last point are not equal).
- Parameters:
positions (
Array) – Cartesian positions of discrete coil points […, 3]- Returns:
DiscreteCoil object
- Return type:
- length(n_samples: int = None)[source]¶
Length of the closed polyline through the discrete positions (exact; n_samples is unused).
- centroid(n_samples: int = None)[source]¶
Length-weighted centroid of the closed polyline (exact: segment midpoints weighted by segment length; n_samples is unused).
- bounding_box(n_samples: int = None)[source]¶
Bounding box (min, max) of the closed polyline: the extrema of a piecewise linear curve are at the vertices (exact; arguments unused).
- curvature(s)[source]¶
Curvature kappa = |x' x x''| / |x’|^3 (1/m) of the space curve, independent of the parametrisation. Returns an array of the shape of s.
- position(s)[source]¶
Position along the coil as a function of arc length
- Parameters:
s (jnp.ndarray) – Arc length(s) along the coil
- Returns:
Cartesian position(s) along the coil
- Return type:
jnp.ndarray
- tangent(s)[source]¶
Tangent vector along the coil as a function of arc length
- Parameters:
s (jnp.ndarray) – Arc length(s) along the coil
- Returns:
Tangent vector(s) along the coil
- Return type:
jnp.ndarray