An instance of this class is created by providing the vector or scalar fields and can then be used to find the path integral for a given path.
The implementation uses Gauss-Legendre quadrature on each segment of a path.
-
Constructor Summary
ConstructorsConstructorDescriptionPathIntegral
(int n, RealValuedFunctThreeOps sf) Constructor for the 3D line integral of a scalar field.PathIntegral
(int n, RealValuedFunctThreeOps xf, RealValuedFunctThreeOps yf, RealValuedFunctThreeOps zf) Constructor for the 3D line integral of a vector field.PathIntegral
(int n, RealValuedFunctTwoOps sf) Constructor for the line integral of a scalar field.PathIntegral
(int n, RealValuedFunctTwoOps xf, RealValuedFunctTwoOps yf) Constructor for the line integral of a vector field. -
Method Summary
Modifier and TypeMethodDescriptiondouble
Compute the integral over a path specified by a path iterator.double
Perform a line integral over the boundary of shape.double
integrate
(Shape shape, AffineTransform af) Perform a line integral over the boundary of shape modified by an affine transform.double
Perform a line integral over a path.double
integrate
(Path3D path, AffineTransform3D af) Perform a line integral over a path modified by an affine transform.double
Compute the integral over a path specified by a path iterator.
-
Constructor Details
-
PathIntegral
Constructor for the line integral of a scalar field. The value of the integral for a path P is $\int f(x,y) ds = \int f(x,y) \frac{ds}{du} du$, where u is the path parameter for P, and where x and y are values on the path corresponding to each value of the path parameter u.If p(x,y) is a polynomial approximation to sf, then the corresponding value for n is the degree of the polynomial p(at+b,ct+d) where t is the independent variable.
- Parameters:
n
- the degree of a polynomial that is an adequate approximation to the function sf(x,y)sf
- a function of x and y providing the value of the scalar field at coordinates (x, y).
-
PathIntegral
Constructor for the line integral of a vector field. The value of the integral for a path P is $\int (F_x(x,y) \frac{dx}{du} + F_y(x,y) \frac{dy}{du}) du$, where the limits of integration are those appropriate for covering a path whose path parameter is u, and where the values of x and y used in the integration are those corresponding to the path parameter.If p(x,y) is a polynomial approximation to xf or yf, then the corresponding value for n is the degree of the polynomial p(at+b,ct+d) where t is the independent variable. The polynomial approximation applies to each segment of the path, where a path segment is determined by the path's path iterator.
- Parameters:
n
- the degree of a polynomial that is an adequate approximation to the functions xf(x,y) and yf(x,y)xf
- a function of x and y providing the value of the X component of a vector field at (x, y)yf
- a function of x and y providing the value of the Y component of a vector field at (x, y)
-
PathIntegral
Constructor for the 3D line integral of a scalar field. The value of the integral for a path P is $\int f(x,y) ds = \int f(x,y) \frac{ds}{du} du = \int f(x,y) \sqrt{(\frac{dx}{du})^2 + (\frac{dy}{du})^2} du$, where u is the path parameter for P, and where x and y are values on the path corresponding to each value of the path parameter u.If p(x,y,z) is a polynomial approximation to sf, then the corresponding value for n is the degree of the polynomial p(at+b,ct+d,et+f) where t is the independent variable. The polynomial approximation applies to each segment of the path, where a path segment is determined by the path's path iterator.
- Parameters:
n
- the degree of a polynomial that is an adequate approximation to the function sf(x,y,z)sf
- a function of x and y providing the value of the scalar field at coordinates (x, y, z).
-
PathIntegral
public PathIntegral(int n, RealValuedFunctThreeOps xf, RealValuedFunctThreeOps yf, RealValuedFunctThreeOps zf) Constructor for the 3D line integral of a vector field. The value of the integral for a path P is $\int (F_x(x,y)\frac{dx}{du} + F_y(x,y)\frac{dy}{du}) du$, where the limits of integration are those appropriate for covering a path whose path parameter is u, and where the values of x and y used in the integration are those corresponding to the path parameter.If p(x,y,z) is a polynomial approximation to xf or yf, then the corresponding value for n is the degree of the polynomial p(at+b,ct+d,et+f) where t is the independent variable. The polynomial approximation applies to each segment of the path, where a path segment is determined by the path's path iterator.
- Parameters:
n
- the degree of a polynomial that is an adequate approximation to the functions xf(x,y,z), yf(x,y,z), and zf(x,y,z)xf
- a function of x and y providing the value of the X component of a vector field at (x, y, z)yf
- a function of x and y providing the value of the Y component of a vector field at (x, y, z)zf
- a function of x and y providing the value of the Z component of a vector field at (x, y, z)
-
-
Method Details
-
integrate
public double integrate(PathIterator pi) throws IllegalArgumentException, UnsupportedOperationException Compute the integral over a path specified by a path iterator.- Parameters:
pi
- the path iterator- Returns:
- the path (or line) integral
- Throws:
IllegalArgumentException
- the path is not a valid path (it must start with aPathIterator.SEG_MOVETO
segment)UnsupportedOperationException
- this instance does not support 2D operations
-
integrate
Perform a line integral over the boundary of shape. A shape will be converted to an Area if it is not already an instance of Area so that the outer boundaries of the shape will be in the counterclockwise direction and the inner boundaries in the clockwise direction. The results will be those for the case where the outer boundary is counterclockwise.The term 'counterclockwise' is defined as the direction of rotation from the positive X axis towards the positive Y axis. This reflects the convention in mathematics where the X axis points right and the Y axis points up, as opposed to the Java convention where the X axis points right and the Y axis points down.
- Parameters:
shape
- the shape- Returns:
- the path integral over the boundary of a shape
- Throws:
IllegalArgumentException
- the path is not a valid path (it must start with aPathIterator.SEG_MOVETO
segment)UnsupportedOperationException
- this instance does not support 2D operations
-
integrate
public double integrate(Shape shape, AffineTransform af) throws IllegalArgumentException, UnsupportedOperationException Perform a line integral over the boundary of shape modified by an affine transform. A shape will be converted to an Area if it is not already an instance of Area so that inner and outer boundaries have opposite orientations. The results will be those for the case where the outer boundary is counterclockwise.The term 'counterclockwise' is defined as the direction of rotation from the positive X axis towards the positive Y axis. This reflects the convention in mathematics where the X axis points right and the Y axis points up, as opposed to the Java convention where the X axis points right and the Y axis points down.
- Parameters:
shape
- the shapeaf
- the affine transform; null for the identity transform- Returns:
- the path integral over the boundary of a shape modified by an affine transform
- Throws:
IllegalArgumentException
- the path is not a valid path (it must start with aPathIterator.SEG_MOVETO
segment)UnsupportedOperationException
- this instance does not support 2D operations
-
integrate
public double integrate(PathIterator3D pi) throws IllegalArgumentException, UnsupportedOperationException Compute the integral over a path specified by a path iterator.- Parameters:
pi
- the path iterator- Returns:
- the path (or line) integral
- Throws:
IllegalArgumentException
- the path is not a valid path (it must start with aPathIterator3D.SEG_MOVETO
segment)UnsupportedOperationException
- this instance does not support 3D operations
-
integrate
Perform a line integral over a path.- Parameters:
path
- the path- Returns:
- the path (or line) integral
- Throws:
IllegalArgumentException
- the path is not a valid path (it must start with aPathIterator.SEG_MOVETO
segment)UnsupportedOperationException
- this instance does not support 3D operations
-
integrate
public double integrate(Path3D path, AffineTransform3D af) throws IllegalArgumentException, UnsupportedOperationException Perform a line integral over a path modified by an affine transform.- Parameters:
path
- the pathaf
- the affine transform; null for the identity transform- Returns:
- the path (or line) integral
- Throws:
IllegalArgumentException
- the path is not a valid path (it must start with aPathIterator3D.SEG_MOVETO
segment)UnsupportedOperationException
- this instance does not support 3D operations
-