public class Circle extends Object implements Hyperplane<Sphere2D>, Embedding<Sphere2D,Sphere1D>
An oriented circle can be defined by a center point. The circle is the the set of points that are in the normal plan the center.
Since it is oriented the two spherical caps at its two sides are unambiguously identified as a left cap and a right cap. This can be used to identify the interior and the exterior in a simple way by local properties only when part of a line is used to define part of a spherical polygon boundary.
Constructor and Description |
---|
Circle(Circle circle)
Copy constructor.
|
Circle(S2Point first,
S2Point second,
double tolerance)
Build a great circle from two non-aligned points.
|
Circle(Vector3D pole,
double tolerance)
Build a great circle from its pole.
|
Modifier and Type | Method and Description |
---|---|
Circle |
copySelf()
Copy the instance.
|
Arc |
getInsideArc(Circle other)
Get the arc of the instance that lies inside the other circle.
|
double |
getOffset(Point<Sphere2D> point)
Get the offset (oriented distance) of a point.
|
double |
getOffset(Vector3D direction)
Get the offset (oriented distance) of a direction.
|
double |
getPhase(Vector3D direction)
Get the phase angle of a direction.
|
Vector3D |
getPointAt(double alpha)
Get a circle point from its phase around the circle.
|
Vector3D |
getPole()
Get the pole of the circle.
|
Circle |
getReverse()
Get the reverse of the instance.
|
double |
getTolerance()
Get the tolerance below which points are considered to belong to the hyperplane.
|
static Transform<Sphere2D,Sphere1D> |
getTransform(Rotation rotation)
Get a
Transform embedding a 3D rotation. |
Vector3D |
getXAxis()
Get the X axis of the circle.
|
Vector3D |
getYAxis()
Get the Y axis of the circle.
|
Point<Sphere2D> |
project(Point<Sphere2D> point)
Project a point to the hyperplane.
|
void |
reset(Vector3D newPole)
Reset the instance as if built from a pole.
|
void |
revertSelf()
Revert the instance.
|
boolean |
sameOrientationAs(Hyperplane<Sphere2D> other)
Check if the instance has the same orientation as another hyperplane.
|
S2Point |
toSpace(Point<Sphere1D> point)
Transform a sub-space point into a space point.
|
S1Point |
toSubSpace(Point<Sphere2D> point)
Transform a space point into a sub-space point.
|
SubCircle |
wholeHyperplane()
Build a sub-hyperplane covering the whole hyperplane.
|
SphericalPolygonsSet |
wholeSpace()
Build a region covering the whole space.
|
public Circle(Vector3D pole, double tolerance)
The circle is oriented in the trigonometric direction around pole.
pole
- circle poletolerance
- tolerance below which close sub-arcs are merged togetherpublic Circle(S2Point first, S2Point second, double tolerance)
The circle is oriented from first to second point using the path smaller than \( \pi \).
first
- first point contained in the great circlesecond
- second point contained in the great circletolerance
- tolerance below which close sub-arcs are merged togetherpublic Circle(Circle circle)
The created instance is completely independent from the original instance, it is a deep copy.
circle
- circle to copypublic Circle copySelf()
The instance created is completely independant of the original one. A deep copy is used, none of the underlying objects are shared (except for immutable objects).
copySelf
in interface Hyperplane<Sphere2D>
public void reset(Vector3D newPole)
The circle is oriented in the trigonometric direction around pole.
newPole
- circle polepublic void revertSelf()
public Circle getReverse()
Get a circle with reversed orientation with respect to the instance. A new object is built, the instance is untouched.
public Point<Sphere2D> project(Point<Sphere2D> point)
project
in interface Hyperplane<Sphere2D>
point
- point to projectpublic double getTolerance()
getTolerance
in interface Hyperplane<Sphere2D>
public S1Point toSubSpace(Point<Sphere2D> point)
toSubSpace
in interface Embedding<Sphere2D,Sphere1D>
point
- n-dimension point of the spacegetPhase(Vector3D)
public double getPhase(Vector3D direction)
The direction may not belong to the circle as the phase is computed for the meridian plane between the circle pole and the direction.
direction
- direction for which phase is requestedtoSubSpace(Point)
public S2Point toSpace(Point<Sphere1D> point)
toSpace
in interface Embedding<Sphere2D,Sphere1D>
point
- (n-1)-dimension point of the sub-spacegetPointAt(double)
public Vector3D getPointAt(double alpha)
alpha
- phase around the circletoSpace(Point)
,
getXAxis()
,
getYAxis()
public Vector3D getXAxis()
This method returns the same value as getPointAt(0.0)
but it does not do any computation and always
return the same instance.
getPointAt(double)
,
getYAxis()
,
getPole()
public Vector3D getYAxis()
This method returns the same value as getPointAt(0.5 * FastMath.PI)
but it does not do any computation and always
return the same instance.
getPointAt(double)
,
getXAxis()
,
getPole()
public Vector3D getPole()
As the circle is a great circle, the pole does not belong to it.
getXAxis()
,
getYAxis()
public Arc getInsideArc(Circle other)
other
- other circlepublic SubCircle wholeHyperplane()
wholeHyperplane
in interface Hyperplane<Sphere2D>
public SphericalPolygonsSet wholeSpace()
wholeSpace
in interface Hyperplane<Sphere2D>
SphericalPolygonsSet
instance)public double getOffset(Point<Sphere2D> point)
The offset is 0 if the point is on the underlying hyperplane, it is positive if the point is on one particular side of the hyperplane, and it is negative if the point is on the other side, according to the hyperplane natural orientation.
getOffset
in interface Hyperplane<Sphere2D>
point
- point to checkgetOffset(Vector3D)
public double getOffset(Vector3D direction)
The offset is defined as the angular distance between the circle center and the direction minus the circle radius. It is therefore 0 on the circle, positive for directions outside of the cone delimited by the circle, and negative inside the cone.
direction
- direction to checkgetOffset(Point)
public boolean sameOrientationAs(Hyperplane<Sphere2D> other)
This method is expected to be called on parallel hyperplanes. The method should not re-check for parallelism, only for orientation, typically by testing something like the sign of the dot-products of normals.
sameOrientationAs
in interface Hyperplane<Sphere2D>
other
- other hyperplane to check against the instanceCopyright © 2003–2016 The Apache Software Foundation. All rights reserved.