ribbon.spiralcartesian module#
Classes for spirals described by a Césaro equation \(\kappa = f(s)\), where \(\kappa\) is the curvature and \(s\) is the arclength.
- class ribbon.spiralcartesian.SpiralCartesianBase[source]#
Bases:
ABCMethods
Returns the cartesian coordinates at the given values of arclengths.
Returns the curvature at the given values of arclengths.
get_tangent(s)Returns the unit tangent vector at the given values of polar or arclength coordinates.
- abstractmethod get_tangent(s)[source]#
Returns the unit tangent vector at the given values of polar or arclength coordinates.
- Parameters:
- sarray_like
Value of the polar coordinates or arclengths.
- Returns:
- ndarray
Unit tangent vectors. Shape is (2,) if s is scalar, else (n,2) where n is the length of s.
- class ribbon.spiralcartesian.SpiralPolynomial(coeffs)[source]#
Bases:
SpiralCartesianBaseThe Césaro equation \(\kappa = f(s)\), where \(f(s)\) is a polynomial in \(s\).
- Parameters:
- coeffsarray_like
Coefficients of the polynomial in order of ascending power, i.e. coeffs[i] is the coefficient of s^i.
Methods
Returns the cartesian coordinates at the given values of arclengths.
Returns the curvature at the given values of arclengths.
get_tangent(s)Returns the unit tangent vector at the given values of polar or arclength coordinates.
Warning
Polynomials with degree greater than 2 often result in self-intersecting, or at least self-touching spirals.
- get_tangent(s)[source]#
Returns the unit tangent vector at the given values of polar or arclength coordinates.
- Parameters:
- sarray_like
Value of the polar coordinates or arclengths.
- Returns:
- ndarray
Unit tangent vectors. Shape is (2,) if s is scalar, else (n,2) where n is the length of s.
- class ribbon.spiralcartesian.SpiralCornu(a)[source]#
Bases:
SpiralCartesianBaseThe Césaro equation is \(\kappa = as\), where \(a > 0\).
- Parameters:
- afloat
Proportionality constant between curvature and arclength. Must be > 0.
Methods
Returns the cartesian coordinates at the given values of arclengths.
Returns the curvature at the given values of arclengths.
get_tangent(s)Returns the unit tangent vector at the given values of polar or arclength coordinates.
- get_tangent(s)[source]#
Returns the unit tangent vector at the given values of polar or arclength coordinates.
- Parameters:
- sarray_like
Value of the polar coordinates or arclengths.
- Returns:
- ndarray
Unit tangent vectors. Shape is (2,) if s is scalar, else (n,2) where n is the length of s.
- class ribbon.spiralcartesian.SpiralNielsen(a, b)[source]#
Bases:
SpiralCartesianBaseThe Césaro equation is \(\kappa = a e^{bs}\), where \(a > 0, b \neq 0\).
- Parameters:
- afloat
Parameter in the Césaro equation. Must be > 0.
- bfloat
Parameter in the Césaro equation. Must be non-zero.
Methods
Returns the cartesian coordinates at the given values of arclengths.
Returns the curvature at the given values of arclengths.
get_tangent(s)Returns the unit tangent vector at the given values of polar or arclength coordinates.
- get_tangent(s)[source]#
Returns the unit tangent vector at the given values of polar or arclength coordinates.
- Parameters:
- sarray_like
Value of the polar coordinates or arclengths.
- Returns:
- ndarray
Unit tangent vectors. Shape is (2,) if s is scalar, else (n,2) where n is the length of s.