Class Circle
- All Implemented Interfaces:
Embedding<Sphere2D,
,Sphere1D> Hyperplane<Sphere2D>
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptioncopySelf()
Copy the instance.Build a sub-hyperplane covering nothing.Get the arc on this circle between two defining points.getInsideArc
(Circle other) Get the arc of the instance that lies inside the other circle.double
Get the offset (oriented distance) of a direction.double
Get the offset (oriented distance) of a point.double
Get the phase angle of a direction.getPointAt
(double alpha) Get a circle point from its phase around the circle.getPole()
Get the pole of the circle.Get the reverse of the instance.double
Get the tolerance below which points are considered to belong to the hyperplane.getTransform
(Rotation rotation) Get aTransform
embedding a 3D rotation.getXAxis()
Get the X axis of the circle.getYAxis()
Get the Y axis of the circle.Project a point to the hyperplane.void
Reset the instance as if built from a pole.void
Revert the instance.boolean
sameOrientationAs
(Hyperplane<Sphere2D> other) Check if the instance has the same orientation as another hyperplane.Transform a sub-space point into a space point.toSubSpace
(Point<Sphere2D> point) Transform a space point into a sub-space point.Build a sub-hyperplane covering the whole hyperplane.Build a region covering the whole space.
-
Constructor Details
-
Circle
Build a great circle from its pole.The circle is oriented in the trigonometric direction around pole.
- Parameters:
pole
- circle poletolerance
- tolerance below which close sub-arcs are merged together- Throws:
MathIllegalArgumentException
- if tolerance is smaller thanSphere1D.SMALLEST_TOLERANCE
-
Circle
Build a great circle from two non-aligned points.The circle is oriented from first to second point using the path smaller than \( \pi \).
- Parameters:
first
- first point contained in the great circlesecond
- second point contained in the great circletolerance
- tolerance below which close sub-arcs are merged together- Throws:
MathIllegalArgumentException
- if tolerance is smaller thanSphere1D.SMALLEST_TOLERANCE
-
Circle
Copy constructor.The created instance is completely independent from the original instance, it is a deep copy.
- Parameters:
circle
- circle to copy
-
-
Method Details
-
copySelf
Copy the instance.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).
- Specified by:
copySelf
in interfaceHyperplane<Sphere2D>
- Returns:
- a new hyperplane, copy of the instance
-
reset
Reset the instance as if built from a pole.The circle is oriented in the trigonometric direction around pole.
- Parameters:
newPole
- circle pole
-
revertSelf
public void revertSelf()Revert the instance. -
getReverse
Get the reverse of the instance.Get a circle with reversed orientation with respect to the instance. A new object is built, the instance is untouched.
- Returns:
- a new circle, with orientation opposite to the instance orientation
-
project
Project a point to the hyperplane.- Specified by:
project
in interfaceHyperplane<Sphere2D>
- Parameters:
point
- point to project- Returns:
- projected point
-
getTolerance
public double getTolerance()Get the tolerance below which points are considered to belong to the hyperplane.- Specified by:
getTolerance
in interfaceHyperplane<Sphere2D>
- Returns:
- tolerance below which points are considered to belong to the hyperplane
-
toSubSpace
Transform a space point into a sub-space point.- Specified by:
toSubSpace
in interfaceEmbedding<Sphere2D,
Sphere1D> - Parameters:
point
- n-dimension point of the space- Returns:
- (n-1)-dimension point of the sub-space corresponding to the specified space point
- See Also:
-
getPhase
Get the phase angle of a 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.
- Parameters:
direction
- direction for which phase is requested- Returns:
- phase angle of the direction around the circle
- See Also:
-
toSpace
Transform a sub-space point into a space point. -
getPointAt
Get a circle point from its phase around the circle.- Parameters:
alpha
- phase around the circle- Returns:
- circle point on the sphere
- See Also:
-
getXAxis
Get the X axis of the circle.This method returns the same value as
getPointAt(0.0)
but it does not do any computation and always return the same instance.- Returns:
- an arbitrary x axis on the circle
- See Also:
-
getYAxis
Get the Y axis of the circle.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.- Returns:
- an arbitrary y axis point on the circle
- See Also:
-
getPole
Get the pole of the circle.As the circle is a great circle, the pole does not belong to it.
- Returns:
- pole of the circle
- See Also:
-
getInsideArc
Get the arc of the instance that lies inside the other circle.- Parameters:
other
- other circle- Returns:
- arc of the instance that lies inside the other circle
-
wholeHyperplane
Build a sub-hyperplane covering the whole hyperplane.- Specified by:
wholeHyperplane
in interfaceHyperplane<Sphere2D>
- Returns:
- a sub-hyperplane covering the whole hyperplane
-
emptyHyperplane
Build a sub-hyperplane covering nothing.- Specified by:
emptyHyperplane
in interfaceHyperplane<Sphere2D>
- Returns:
- a sub-hyperplane covering nothing
-
wholeSpace
Build a region covering the whole space.- Specified by:
wholeSpace
in interfaceHyperplane<Sphere2D>
- Returns:
- a region containing the instance (really a
SphericalPolygonsSet
instance)
-
getOffset
Get the offset (oriented distance) of a 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.
- Specified by:
getOffset
in interfaceHyperplane<Sphere2D>
- Parameters:
point
- point to check- Returns:
- offset of the point
- See Also:
-
getOffset
Get the offset (oriented distance) of a 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.
- Parameters:
direction
- direction to check- Returns:
- offset of the direction
- See Also:
-
sameOrientationAs
Check if the instance has the same orientation as another hyperplane.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.
- Specified by:
sameOrientationAs
in interfaceHyperplane<Sphere2D>
- Parameters:
other
- other hyperplane to check against the instance- Returns:
- true if the instance and the other hyperplane have the same orientation
-
getArc
Get the arc on this circle between two defining points. Only the point's projection on the circle matters, which is computed usinggetPhase(Vector3D)
.- Parameters:
a
- first point.b
- second point.- Returns:
- an arc of the circle.
-
getTransform
Get aTransform
embedding a 3D rotation.- Parameters:
rotation
- rotation to use- Returns:
- a new transform that can be applied to either
Point
,Line
orSubHyperplane
instances
-