Package | Description |
---|---|
org.apache.commons.geometry.euclidean.threed |
This package provides basic 3D geometry components.
|
org.apache.commons.geometry.euclidean.twod |
This package provides basic 2D geometry components.
|
org.apache.commons.geometry.euclidean.twod.path |
This package provides classes for working with connected sequences of
line segments and other line subsets.
|
org.apache.commons.geometry.euclidean.twod.rotation |
This package provides components related to rotations in 2 dimensional
Euclidean space.
|
org.apache.commons.geometry.euclidean.twod.shape |
This package provides utilities for constructing basic 2D shapes.
|
Modifier and Type | Method and Description |
---|---|
Vector2D |
EmbeddingPlane.toSubspace(Vector3D point)
Transform a 3D space point into an in-plane point.
|
Modifier and Type | Method and Description |
---|---|
HyperplaneBoundedRegion<Vector2D> |
PlaneSubset.Embedded.getSubspaceRegion() |
Modifier and Type | Method and Description |
---|---|
Vector3D |
EmbeddingPlane.pointAt(Vector2D inPlane,
double offset)
Get one point from the 3D-space.
|
Vector3D |
EmbeddingPlane.toSpace(Vector2D point)
Transform an in-plane point into a 3D space point.
|
Modifier and Type | Method and Description |
---|---|
static List<PlaneConvexSubset> |
Planes.extrudeVertexLoop(List<Vector2D> vertices,
EmbeddingPlane plane,
Vector3D extrusionVector,
Precision.DoubleEquivalence precision)
Get the boundaries of a 3D region created by extruding a polygon defined by a list of vertices.
|
Modifier and Type | Class and Description |
---|---|
static class |
Vector2D.Unit
Represents unit vectors.
|
Modifier and Type | Field and Description |
---|---|
static Vector2D |
Vector2D.NaN
A vector with all coordinates set to NaN.
|
static Vector2D |
Vector2D.NEGATIVE_INFINITY
A vector with all coordinates set to negative infinity.
|
static Vector2D |
Vector2D.POSITIVE_INFINITY
A vector with all coordinates set to positive infinity.
|
static Vector2D |
Vector2D.ZERO
Zero vector (coordinates: 0, 0).
|
Modifier and Type | Field and Description |
---|---|
static Comparator<Vector2D> |
Vector2D.COORDINATE_ASCENDING_ORDER
Comparator that sorts vectors in component-wise ascending order.
|
Modifier and Type | Method and Description |
---|---|
Vector2D |
Vector2D.add(double factor,
Vector2D v) |
Vector2D |
Vector2D.add(Vector2D v) |
Vector2D |
AffineTransformMatrix2D.apply(Vector2D pt)
Apply this transform to the given point, returning the result as a new instance.
|
Vector2D |
AffineTransformMatrix2D.applyVector(Vector2D vec)
Apply this transform to the given vector, ignoring translations.
|
static Vector2D |
Vector2D.centroid(Iterable<Vector2D> pts)
Compute the centroid of the given points.
|
static Vector2D |
Vector2D.centroid(Vector2D first,
Vector2D... more)
Compute the centroid of the given points.
|
Vector2D |
EmbeddedTreeLineSubset.closest(Vector2D pt) |
Vector2D |
LineConvexSubset.closest(Vector2D pt) |
Vector2D |
Vector2D.Sum.get() |
Vector2D |
ReverseRay.getCentroid() |
Vector2D |
Segment.getCentroid() |
Vector2D |
ConvexArea.getCentroid() |
Vector2D |
EmbeddedTreeLineSubset.getCentroid() |
Vector2D |
Ray.getCentroid() |
Vector2D |
Ray.getDirection()
Get the direction of the ray.
|
Vector2D |
ReverseRay.getEndPoint()
Get the end point for the subset.
|
Vector2D |
Segment.getEndPoint()
Get the end point for the subset.
|
Vector2D |
Ray.getEndPoint()
Get the end point for the subset.
|
abstract Vector2D |
LineConvexSubset.getEndPoint()
Get the end point for the subset.
|
Vector2D |
Line.getOffsetDirection()
Get the offset direction of the line.
|
Vector2D |
Line.getOrigin()
Get the line origin point.
|
Vector2D |
ReverseRay.getStartPoint()
Get the start point for the subset.
|
Vector2D |
Segment.getStartPoint()
Get the start point for the subset.
|
Vector2D |
Ray.getStartPoint() |
abstract Vector2D |
LineConvexSubset.getStartPoint()
Get the start point for the subset.
|
Vector2D |
Vector2D.getZero() |
Vector2D |
Line.intersection(Line other)
Get the intersection point of the instance and another line.
|
Vector2D |
LineSubset.intersection(Line inputLine)
Get the unique intersection of this subset with the given line.
|
Vector2D |
LineSubset.intersection(LineSubset subset)
Get the unique intersection of this instance with the given line subset.
|
Vector2D |
Vector2D.lerp(Vector2D p,
double t)
Get a vector constructed by linearly interpolating between this vector and the given vector.
|
static Vector2D |
Vector2D.max(Iterable<Vector2D> vecs)
Return a vector containing the maximum component values from all input vectors.
|
static Vector2D |
Vector2D.max(Vector2D first,
Vector2D... more)
Return a vector containing the maximum component values from all input vectors.
|
static Vector2D |
Vector2D.min(Iterable<Vector2D> vecs)
Return a vector containing the minimum component values from all input vectors.
|
static Vector2D |
Vector2D.min(Vector2D first,
Vector2D... more)
Return a vector containing the minimum component values from all input vectors.
|
Vector2D |
Vector2D.multiply(double a) |
Vector2D |
Vector2D.negate() |
static Vector2D |
Vector2D.of(double[] v)
Creates a vector from the coordinates in the given 2-element array.
|
static Vector2D |
Vector2D.of(double x,
double y)
Returns a vector with the given coordinate values.
|
static Vector2D |
Vector2D.parse(String str)
Parses the given string and returns a new vector instance.
|
Vector2D |
Line.pointAt(double abscissa,
double offset)
Get one point from the plane, relative to the coordinate system
of the line.
|
Vector2D |
Line.project(Vector2D point) |
Vector2D |
Vector2D.project(Vector2D base)
Get the projection of the instance onto the given base vector.
|
Vector2D |
RegionBSPTree2D.project(Vector2D pt) |
Vector2D |
Vector2D.reject(Vector2D base)
Get the rejection of the instance from the given base vector.
|
Vector2D |
Vector2D.subtract(double factor,
Vector2D v) |
Vector2D |
Vector2D.subtract(Vector2D v) |
Vector2D |
PolarCoordinates.toCartesian()
Convert this set of polar coordinates to Cartesian coordinates.
|
static Vector2D |
PolarCoordinates.toCartesian(double radius,
double azimuth)
Convert the given polar coordinates to Cartesian form.
|
Vector2D |
Line.toSpace(double abscissa)
Convert the given abscissa value (1D location on the line)
into a 2D point.
|
Vector2D |
Line.toSpace(Vector1D point) |
Vector2D |
LineSubset.toSpace(Vector1D pt) |
Vector2D |
Vector2D.transform(UnaryOperator<Vector2D> fn)
Convenience method to apply a function to this vector.
|
Vector2D |
Vector2D.vectorTo(Vector2D v)
Return the vector representing the displacement from this vector
to the given vector.
|
Vector2D |
Vector2D.withNorm(double magnitude) |
Vector2D |
Vector2D.Unit.withNorm(double mag) |
Modifier and Type | Method and Description |
---|---|
protected AbstractRegionBSPTree.RegionSizeProperties<Vector2D> |
RegionBSPTree2D.computeRegionSizeProperties() |
List<Vector2D> |
ConvexArea.getVertices()
Get the vertices for the area in a counter-clockwise order.
|
Modifier and Type | Method and Description |
---|---|
double |
Line.abscissa(Vector2D point)
Get the abscissa of the given point on the line.
|
Vector2D |
Vector2D.add(double factor,
Vector2D v) |
Vector2D |
Vector2D.add(Vector2D v) |
Vector2D.Sum |
Vector2D.Sum.add(Vector2D vec)
Add a vector to this instance.
|
Bounds2D.Builder |
Bounds2D.Builder.add(Vector2D pt)
Add a point to this instance.
|
Vector2D.Sum |
Vector2D.Sum.addScaled(double scale,
Vector2D vec)
Add a scaled vector to this instance.
|
double |
Vector2D.angle(Vector2D v) |
Vector2D |
AffineTransformMatrix2D.apply(Vector2D pt)
Apply this transform to the given point, returning the result as a new instance.
|
Vector2D.Unit |
AffineTransformMatrix2D.applyDirection(Vector2D vec)
Apply this transform to the given vector, ignoring translations and normalizing the
result.
|
Vector2D |
AffineTransformMatrix2D.applyVector(Vector2D vec)
Apply this transform to the given vector, ignoring translations.
|
static Vector2D |
Vector2D.centroid(Vector2D first,
Vector2D... more)
Compute the centroid of the given points.
|
static Vector2D |
Vector2D.centroid(Vector2D first,
Vector2D... more)
Compute the centroid of the given points.
|
RegionLocation |
LineSubset.classify(Vector2D pt) |
Vector2D |
EmbeddedTreeLineSubset.closest(Vector2D pt) |
Vector2D |
LineConvexSubset.closest(Vector2D pt) |
boolean |
Line.contains(Vector2D p)
Check if the line contains a point.
|
boolean |
Bounds2D.contains(Vector2D pt)
Return true if the given point is strictly within or on the boundary of the bounding box.
|
boolean |
Bounds2D.contains(Vector2D pt,
Precision.DoubleEquivalence precision)
Return true if the given point is within or on the boundary of the bounding box, using the given
precision context for floating point comparisons.
|
static AffineTransformMatrix2D |
AffineTransformMatrix2D.createRotation(Vector2D center,
double angle)
Create a transform representing a counterclockwise rotation of
angle
radians around the given center point. |
static AffineTransformMatrix2D |
AffineTransformMatrix2D.createRotation(Vector2D center,
Rotation2D rotation)
Create a transform representing a counterclockwise rotation around the given center point.
|
static AffineTransformMatrix2D |
AffineTransformMatrix2D.createScale(Vector2D factors)
Create a transform representing a scale operation.
|
static AffineTransformMatrix2D |
AffineTransformMatrix2D.createTranslation(Vector2D translation)
Create a transform representing the given translation.
|
Vector2D.Unit |
Vector2D.directionTo(Vector2D v)
Return the unit vector representing the direction of displacement from this
vector to the given vector.
|
double |
Line.distance(Vector2D p)
Compute the distance between the instance and a point.
|
double |
Vector2D.distance(Vector2D v) |
double |
Vector2D.distanceSq(Vector2D v) |
double |
Vector2D.dot(Vector2D v) |
boolean |
Vector2D.eq(Vector2D vec,
Precision.DoubleEquivalence precision)
Return true if the current instance and given vector are considered equal as evaluated by the
given precision context.
|
static Vector2D.Unit |
Vector2D.Unit.from(Vector2D v)
Create a normalized vector.
|
static Bounds2D |
Bounds2D.from(Vector2D first,
Vector2D... more)
Construct a new instance from the given points.
|
static Bounds2D |
Bounds2D.from(Vector2D first,
Vector2D... more)
Construct a new instance from the given points.
|
static PolarCoordinates |
PolarCoordinates.fromCartesian(Vector2D vec)
Convert the given Cartesian coordinates to polar form.
|
static AffineTransformMatrix2D |
AffineTransformMatrix2D.fromColumnVectors(Vector2D u,
Vector2D v)
Get a new transform create from the given column vectors.
|
static AffineTransformMatrix2D |
AffineTransformMatrix2D.fromColumnVectors(Vector2D u,
Vector2D v,
Vector2D t)
Get a new transform created from the given column vectors.
|
static Line |
Lines.fromPointAndAngle(Vector2D pt,
double angle,
Precision.DoubleEquivalence precision)
Create a line from a point lying on the line and an angle relative to the abscissa (x) axis.
|
static Line |
Lines.fromPointAndDirection(Vector2D pt,
Vector2D dir,
Precision.DoubleEquivalence precision)
Create a line from a point and direction.
|
static Line |
Lines.fromPoints(Vector2D p1,
Vector2D p2,
Precision.DoubleEquivalence precision)
Create a line from two points lying on the line.
|
RegionBSPTree2D.PartitionedRegionBuilder2D |
RegionBSPTree2D.PartitionedRegionBuilder2D.insertAxisAlignedPartitions(Vector2D center,
Precision.DoubleEquivalence precision)
Insert two axis aligned lines intersecting at the given point as partitions.
|
Vector2D |
Vector2D.lerp(Vector2D p,
double t)
Get a vector constructed by linearly interpolating between this vector and the given vector.
|
static Vector2D |
Vector2D.max(Vector2D first,
Vector2D... more)
Return a vector containing the maximum component values from all input vectors.
|
static Vector2D |
Vector2D.max(Vector2D first,
Vector2D... more)
Return a vector containing the maximum component values from all input vectors.
|
static Vector2D |
Vector2D.min(Vector2D first,
Vector2D... more)
Return a vector containing the minimum component values from all input vectors.
|
static Vector2D |
Vector2D.min(Vector2D first,
Vector2D... more)
Return a vector containing the minimum component values from all input vectors.
|
static Vector2D.Sum |
Vector2D.Sum.of(Vector2D initial)
Construct a new instance with an initial value set to the argument.
|
static Vector2D.Sum |
Vector2D.Sum.of(Vector2D first,
Vector2D... more)
Construct a new instance from multiple values.
|
static Vector2D.Sum |
Vector2D.Sum.of(Vector2D first,
Vector2D... more)
Construct a new instance from multiple values.
|
double |
Line.offset(Vector2D point) |
Vector2D.Unit |
Vector2D.orthogonal(Vector2D dir)
Get a unit vector orthogonal to the current vector and pointing in the direction
of
dir . |
Vector2D |
Line.project(Vector2D point) |
Vector2D |
Vector2D.project(Vector2D base)
Get the projection of the instance onto the given base vector.
|
Vector2D |
RegionBSPTree2D.project(Vector2D pt) |
Ray |
Line.rayFrom(Vector2D startPoint)
Create a new ray instance that starts at the projection of the given point
and continues in the direction of the line to infinity.
|
static Ray |
Lines.rayFromPoint(Line line,
Vector2D startPoint)
Construct a ray starting at the given point and continuing to infinity in the direction
of
line . |
static Ray |
Lines.rayFromPointAndDirection(Vector2D startPoint,
Vector2D direction,
Precision.DoubleEquivalence precision)
Construct a ray from a start point and a direction.
|
Vector2D |
Vector2D.reject(Vector2D base)
Get the rejection of the instance from the given base vector.
|
static ReverseRay |
Lines.reverseRayFromPoint(Line line,
Vector2D endPoint)
Construct a reverse ray starting at infinity and continuing in the direction of
line
to the given end point. |
static ReverseRay |
Lines.reverseRayFromPointAndDirection(Vector2D endPoint,
Vector2D lineDirection,
Precision.DoubleEquivalence precision)
Construct a reverse ray from an end point and a line direction.
|
ReverseRay |
Line.reverseRayTo(Vector2D endPoint)
Create a new convex line subset that starts at infinity and continues along
the line up to the projection of the given end point.
|
AffineTransformMatrix2D |
AffineTransformMatrix2D.rotate(Vector2D center,
double angle)
Apply a counterclockwise rotation about the given center point to the current instance,
returning the result as a new transform.
|
AffineTransformMatrix2D |
AffineTransformMatrix2D.rotate(Vector2D center,
Rotation2D rotation)
Apply a counterclockwise rotation about the given center point to the current instance,
returning the result as a new transform.
|
AffineTransformMatrix2D |
AffineTransformMatrix2D.scale(Vector2D scaleFactors)
Apply a scale operation to the current instance, returning the result as a new transform.
|
Segment |
Line.segment(Vector2D a,
Vector2D b)
Create a new line segment from two points.
|
static Segment |
Lines.segmentFromPoints(Line line,
Vector2D a,
Vector2D b)
Construct a new line segment from a line and a pair of points.
|
static Segment |
Lines.segmentFromPoints(Vector2D startPoint,
Vector2D endPoint,
Precision.DoubleEquivalence precision)
Construct a new line segment from two points.
|
double |
Vector2D.signedArea(Vector2D v)
Compute the signed area of the parallelogram with sides formed by this instance
and the given vector.
|
protected Split<LineConvexSubset> |
ReverseRay.splitOnIntersection(Line splitter,
Vector2D intersection)
Split this instance using the given splitter line and intersection point.
|
Vector2D |
Vector2D.subtract(double factor,
Vector2D v) |
Vector2D |
Vector2D.subtract(Vector2D v) |
Vector1D |
Line.toSubspace(Vector2D point) |
Vector1D |
LineSubset.toSubspace(Vector2D pt) |
AffineTransformMatrix2D |
AffineTransformMatrix2D.translate(Vector2D translation)
Apply a translation to the current instance, returning the result as a new transform.
|
Vector2D |
Vector2D.vectorTo(Vector2D v)
Return the vector representing the displacement from this vector
to the given vector.
|
Modifier and Type | Method and Description |
---|---|
Bounds2D.Builder |
Bounds2D.Builder.addAll(Iterable<? extends Vector2D> pts)
Add a collection of points to this instance.
|
static Vector2D |
Vector2D.centroid(Iterable<Vector2D> pts)
Compute the centroid of the given points.
|
static ConvexArea |
ConvexArea.convexPolygonFromVertices(Collection<Vector2D> vertices,
Precision.DoubleEquivalence precision)
Construct a convex polygon from the given vertices.
|
static Bounds2D |
Bounds2D.from(Iterable<Vector2D> points)
Construct a new instance from the given points.
|
static AffineTransformMatrix2D |
AffineTransformMatrix2D.from(UnaryOperator<Vector2D> fn)
Construct a new transform representing the given function.
|
static Vector2D |
Vector2D.max(Iterable<Vector2D> vecs)
Return a vector containing the maximum component values from all input vectors.
|
static Vector2D |
Vector2D.min(Iterable<Vector2D> vecs)
Return a vector containing the minimum component values from all input vectors.
|
boolean |
Line.similarOrientation(Hyperplane<Vector2D> other) |
Split<ConvexArea> |
ConvexArea.split(Hyperplane<Vector2D> splitter) |
Split<EmbeddedTreeLineSubset> |
EmbeddedTreeLineSubset.split(Hyperplane<Vector2D> splitter) |
Split<RegionBSPTree2D> |
RegionBSPTree2D.split(Hyperplane<Vector2D> splitter) |
Split<LineConvexSubset> |
LineConvexSubset.split(Hyperplane<Vector2D> splitter) |
Line.SubspaceTransform |
Line.subspaceTransform(Transform<Vector2D> transform)
Get an object containing the current line transformed by the argument along with a
1D transform that can be applied to subspace points.
|
ReverseRay |
ReverseRay.transform(Transform<Vector2D> transform) |
Segment |
Segment.transform(Transform<Vector2D> transform) |
ConvexArea |
ConvexArea.transform(Transform<Vector2D> transform)
Return a new instance transformed by the argument.
|
Line |
Line.transform(Transform<Vector2D> transform) |
EmbeddedTreeLineSubset |
EmbeddedTreeLineSubset.transform(Transform<Vector2D> transform) |
Ray |
Ray.transform(Transform<Vector2D> transform) |
abstract LineConvexSubset |
LineConvexSubset.transform(Transform<Vector2D> transform) |
Vector2D |
Vector2D.transform(UnaryOperator<Vector2D> fn)
Convenience method to apply a function to this vector.
|
LineConvexSubset |
ConvexArea.trim(HyperplaneConvexSubset<Vector2D> convexSubset) |
Constructor and Description |
---|
LinecastPoint2D(Vector2D point,
Vector2D normal,
Line line)
Construct a new instance from its components.
|
Modifier and Type | Method and Description |
---|---|
List<Vector2D> |
LinePath.getVertexSequence()
Get the sequence of vertices defined by the path.
|
Modifier and Type | Method and Description |
---|---|
LinePath.Builder |
LinePath.Builder.append(Vector2D vertex)
Add a vertex to the end of this path.
|
LinePath.Builder |
LinePath.Builder.appendVertices(Vector2D... vertices)
Convenience method for appending multiple vertices to the path at once.
|
LinePath.Builder |
LinePath.Builder.prepend(Vector2D vertex)
Add a vertex to the front of this path.
|
LinePath.Builder |
LinePath.Builder.prependVertices(Vector2D... vertices)
Convenience method for prepending multiple vertices to the path in a single method call.
|
Modifier and Type | Method and Description |
---|---|
LinePath.Builder |
LinePath.Builder.appendVertices(Collection<? extends Vector2D> vertices)
Convenience method for appending a collection of vertices to the path in a single method call.
|
static LinePath |
LinePath.fromVertexLoop(Collection<Vector2D> vertices,
Precision.DoubleEquivalence precision)
Build a new path from the given vertices.
|
static LinePath |
LinePath.fromVertices(Collection<Vector2D> vertices,
boolean close,
Precision.DoubleEquivalence precision)
Build a new path from the given vertices.
|
static LinePath |
LinePath.fromVertices(Collection<Vector2D> vertices,
Precision.DoubleEquivalence precision)
Build a new path from the given vertices.
|
LinePath.Builder |
LinePath.Builder.prependVertices(Collection<Vector2D> vertices)
Convenience method for prepending a collection of vertices to the path in a single method call.
|
LinePath |
LinePath.transform(Transform<Vector2D> transform)
Transform this instance with the argument, returning the result in a new instance.
|
Constructor and Description |
---|
ConnectableLineSubset(Vector2D start)
Create a new instance with the given start point.
|
Modifier and Type | Method and Description |
---|---|
Vector2D |
Rotation2D.apply(Vector2D pt) |
Vector2D |
Rotation2D.applyVector(Vector2D vec)
Apply this transform to the given vector, ignoring translations.
|
Modifier and Type | Method and Description |
---|---|
Vector2D |
Rotation2D.apply(Vector2D pt) |
Vector2D |
Rotation2D.applyVector(Vector2D vec)
Apply this transform to the given vector, ignoring translations.
|
static Rotation2D |
Rotation2D.createVectorRotation(Vector2D u,
Vector2D v)
Create a rotation instance that rotates the vector
u to point in the direction of
vector v . |
Modifier and Type | Method and Description |
---|---|
Vector2D |
Circle.firstIntersection(Line line)
Get the first intersection point between the given line and this circle, or null
if no such point exists.
|
Vector2D |
Circle.project(Vector2D pt) |
Modifier and Type | Method and Description |
---|---|
List<Vector2D> |
Circle.intersections(Line line)
Get the intersections of the given line with this circle.
|
Modifier and Type | Method and Description |
---|---|
static Parallelogram |
Parallelogram.axisAligned(Vector2D a,
Vector2D b,
Precision.DoubleEquivalence precision)
Return a new instance representing an axis-aligned rectangle.
|
static Circle |
Circle.from(Vector2D center,
double radius,
Precision.DoubleEquivalence precision)
Construct a circle from a center point and radius.
|
Vector2D |
Circle.project(Vector2D pt) |
Parallelogram.Builder |
Parallelogram.Builder.setPosition(Vector2D pos)
Set the center position of the created parallelogram.
|
Parallelogram.Builder |
Parallelogram.Builder.setScale(Vector2D scaleFactors)
Set the scaling for the created parallelogram.
|
Parallelogram.Builder |
Parallelogram.Builder.setXDirection(Vector2D xDirection)
Set the rotation of the created parallelogram such that the
relative x-axis of the shape points in the given direction.
|
Parallelogram.Builder |
Parallelogram.Builder.setYDirection(Vector2D yDirection)
Set the rotation of the created parallelogram such that the
relative y-axis of the shape points in the given direction.
|
Modifier and Type | Method and Description |
---|---|
static Parallelogram |
Parallelogram.fromTransformedUnitSquare(Transform<Vector2D> transform,
Precision.DoubleEquivalence precision)
Create a new instance by transforming a unit square centered at the origin.
|
Copyright © 2016–2021 The Apache Software Foundation. All rights reserved.