A class for the parametric representation of a line segment in 2-D.
Public Fields
-
bool periodic
- set this to true if segment closes upon itself
-
double tmin
- min of time-like parameter
-
double tmax
- max of time-like parameter
-
double xg
- x position of centre of gravity
-
double yg
- y position of centre of gravity
-
double length
- typical length scale of segment
Public Methods
-
segment()
- Constructor.
-
segment(const Vec &t_in, const Vec &x_in, const Vec &y_in, bool periodic_in=false)
- Constructor.
-
bool operator==(const segment &sb)
- Identity (check is based on memory address, thus the test returns false if the two objects have the same (t, x, y) support but are not the same instance).
-
void load(const Vec &t_in, const Vec &x_in, const Vec &y_in, bool periodic_in=true)
- Build object.
-
void plot(bool hold=true, bool display=true, bool freshstart=true)
- Simple 2-D plot.
-
double x(const double &ti)
- Get x at ti.
-
Vec x(const Vec &ti)
- Get x at ti.
-
double y(const double &ti)
- Get y at ti.
-
Vec y(const Vec &ti)
- Get y at ti.
-
double xDot(const double &ti)
- Get dx/dt at ti.
-
Vec xDot(const Vec &ti)
- Get dx/dt at ti.
-
double yDot(const double &ti)
- Get dy/dt at ti.
-
Vec yDot(const Vec &ti)
- Get dy/dt at ti.
-
double arcLengthIntegral(double (f)(double* ))
- Get integral dl*f(t) over segment.
-
double arcLengthIntegral(double (f)(double* ), const double &ti)
- Get integral dl*f(t) up to ti.
-
Vec arcLengthIntegral(double (f)(double* ), const Vec &ti)
- Get integral dl*f(t) up to ti.
-
double arcLength(void)
- Get the arc length.
-
double arcLength(const double &ti)
- Get the arc length up to ti.
-
Vec arcLength(const Vec &ti)
- Get the arc length up to ti.
-
double arcLengthDot(const double &ti)
- Get dl/dt at ti.
-
Vec arcLengthDot(const Vec &ti)
- Get dl/dt at ti.
Documentation
A class for the parametric representation of a line segment in
2-D. Segment uses a cubic spline representation of x(t) and y(t)
where t is the parametric variable and plays the role of a time-like
variable. Segment has methods to compute the derivative of x and y
versus t at any point. Likewise, there are methods to compute the arc length
and other integrals.
bool periodic
- set this to true if segment closes upon itself
double tmin
- min of time-like parameter
double tmax
- max of time-like parameter
double xg
- x position of centre of gravity
double yg
- y position of centre of gravity
double length
- typical length scale of segment
segment()
-
Constructor.
- See Also:
- load
segment(const Vec &t_in, const Vec &x_in, const Vec &y_in, bool periodic_in=false)
-
Constructor. Similar to calling segment() followed by load method.
- Parameters:
- t_in - time-like sampling (must be in increasing order)
x_in - x positions
y_in - y positions
periodic_in - set this to true if segment closes upon itself
- See Also:
- load
bool operator==(const segment &sb)
- Identity (check is based on memory address, thus the test returns false
if the two objects have the same (t, x, y) support but are not the
same instance).
- Parameters:
- other - segment
void load(const Vec &t_in, const Vec &x_in, const Vec &y_in, bool periodic_in=true)
- Build object. Use this method if nor argument c'tor was used.
- Parameters:
- t_in - time-like slices (must be in increasing order)
x_in - x positions
y_in - y positions
periodic_in - set this to true if segment closes upon itself
- See Also:
- segment()
void plot(bool hold=true, bool display=true, bool freshstart=true)
- Simple 2-D plot.
- Parameters:
- - hold set this to true if several segment plots are to overlap
- display set this to true to have window popping up
- freshstart set this to true to erase any previously stored plot object
double x(const double &ti)
- Get x at ti. Uses a cubic spline interpolation to get the coordinate.
- Parameters:
- ti - 'time'
- Returns:
- x position
Vec x(const Vec &ti)
- Get x at ti. Uses a cubic spline interpolation to get the coordinate.
- Parameters:
- ti - 'time'
- Returns:
- x position
double y(const double &ti)
- Get y at ti. Uses a cubic spline interpolation to get the coordinate.
- Parameters:
- ti - 'time'
- Returns:
- y position
Vec y(const Vec &ti)
- Get y at ti. Uses a cubic spline interpolation to get the coordinate.
- Parameters:
- ti - 'time'
- Returns:
- y position
double xDot(const double &ti)
- Get dx/dt at ti. Uses a cubic spline interpolation to get the coordinate.
- Parameters:
- ti - 'time'
- Returns:
- xt = dx/dt
Vec xDot(const Vec &ti)
- Get dx/dt at ti. Uses a cubic spline interpolation to get the coordinate.
- Parameters:
- ti - 'time'
- Returns:
- xt = dx/dt
double yDot(const double &ti)
- Get dy/dt at ti. Uses a cubic spline interpolation to get the coordinate.
- Parameters:
- ti - 'time'
- Returns:
- yt = dy/dt
Vec yDot(const Vec &ti)
- Get dy/dt at ti. Uses a cubic spline interpolation to get the coordinate.
- Parameters:
- ti - 'time'
- Returns:
- yt = dy/dt
double arcLengthIntegral(double (f)(double* ))
- Get integral dl*f(t) over segment. Here, dl is the infinitesimal arc
length element.
- Parameters:
- f - integrand
- Returns:
- integral = integral dl*f(t)
double arcLengthIntegral(double (f)(double* ), const double &ti)
- Get integral dl*f(t) up to ti. Here, dl is the infinitesimal arc length element.
- Parameters:
- f - integrand
ti - right end point
- Returns:
- integral = integral dl*f(t) to ti
Vec arcLengthIntegral(double (f)(double* ), const Vec &ti)
- Get integral dl*f(t) up to ti. Here, dl is the infinitesimal arc length element.
- Parameters:
- f - integrand
ti - right end point
- Returns:
- integral = integral dl*f(t) to ti
double arcLength(void)
- Get the arc length. Equivalent to integral dl.
Here, dl is the infinitesimal arc element.
- Returns:
- integral = integral dl over segment
double arcLength(const double &ti)
- Get the arc length up to ti. Equivalent to integral dl over[tmin, ti].
- Parameters:
- ti - right end point
- Returns:
- integral = integral dl over segment
Vec arcLength(const Vec &ti)
- Get the arc length up to ti. Equivalent to integral dl over[tmin, ti].
- Parameters:
- ti - right end point
- Returns:
- integral = integral dl over segment
double arcLengthDot(const double &ti)
- Get dl/dt at ti. Here, dl is the infinitesimal arc length element.
- Parameters:
- ti - 'time'
- Returns:
- lt the derivative dl/dt l is the arc length
Vec arcLengthDot(const Vec &ti)
- Get dl/dt at ti.
- Parameters:
- ti - 'time'
- Returns:
- lt the derivative dl/dt l is the arc length
- This class has no child classes.
Alphabetic index HTML hierarchy of classes or Java
This page was generated with the help of DOC++.