aerocaps.geom.curves.PCurveData2D#
- class PCurveData2D(t: float, x: float, y: float, xp: float, yp: float, xpp: float, ypp: float, k: float = None, R: float = None)[source]#
Bases:
objectData-processing class for 2-D parametric curves
- __init__(t: float, x: float, y: float, xp: float, yp: float, xpp: float, ypp: float, k: float = None, R: float = None)[source]#
Data-processing class for 2-D parametric curves. Adds convenience methods for plotting, approximating arc length, and computing curvature combs.
- Parameters:
t (float or numpy.ndarray) – \(t\)-value or vector for the curve
x (float or numpy.ndarray) – Value of the curve in the \(x\)-direction
y (float or numpy.ndarray) – Value of the curve in the \(y\)-direction
xp (float or numpy.ndarray) – First derivative \(x\)-component of the curve with respect to \(t\)
yp (float or numpy.ndarray) – First derivative \(y\)-component of the curve with respect to \(t\)
xpp (float or numpy.ndarray) – Second derivative \(x\)-component of the curve with respect to \(t\)
ypp (float or numpy.ndarray) – Second derivative \(y\)-component of the curve with respect to \(t\)
k (float or v.ndarray) – Curvature of the curve. If not specified, it will be computed. Default:
NoneR (float or numpy.ndarray) – Radius of curvature of the curve. If not specified, it will be computed. Default:
None
Methods
Approximates the arc-length of the curve by summing the arc-lengths of each segment of the evaluated polyline
get_curvature_comb(max_comb_length[, interval])Gets the curvature comb for the curve
plot(ax, **kwargs)Plots the curve on a
matplotlib.pyplot.Axes- approximate_arc_length() ndarray[source]#
Approximates the arc-length of the curve by summing the arc-lengths of each segment of the evaluated polyline
Note
This method will raise an exception if
tis afloat- Returns:
1-D array with \((\text{len}(t) - 1)\) elements
- Return type:
- get_curvature_comb(max_comb_length: float, interval: int = 1) -> (<class 'numpy.ndarray'>, <class 'numpy.ndarray'>)[source]#
Gets the curvature comb for the curve
Note
This method will raise an exception if
tis afloat- Parameters:
max_comb_length (float) – Length of the comb corresponding to the location of maximum unsigned curvature
interval (int) – Interval between the output combs. If
1, the combs corresponding to every evaluated \(t\)-value will be used. If2, every other comb will be skipped, etc. The first and last combs are guaranteed to be output as long aslen(t) > 1. Default:1
- Returns:
2-D arrays corresponding to the comb heads and comb tails, respectively. Each array has outer dimension dependent on the interval (if
interval=1, the length of this dimension will belen(t)) and inner dimension 2- Return type:
- plot(ax: Axes, **kwargs)[source]#
Plots the curve on a
matplotlib.pyplot.AxesNote
If
tis afloat, specifying themarkerkeyword argument may be desirable as a line plot cannot be generated in this case- Parameters:
ax (plt.Axes) – Axis on which to plot
kwargs (dict) – Keyword arguments to pass to
matplotlib.pyplot.Axes.plot