Top Description Inners Fields Constructors Methods
org.apache.commons.math3.geometry.spherical.twod

public Class Circle

extends Object
implements Hyperplane<Sphere2D>, Embedding<Sphere2D, Sphere1D>
Class Inheritance
All Implemented Interfaces
org.apache.commons.math3.geometry.partitioning.Embedding, org.apache.commons.math3.geometry.partitioning.Hyperplane
Imports
org.apache.commons.math3.geometry.Point, org.apache.commons.math3.geometry.euclidean.threed.Rotation, .Vector3D, org.apache.commons.math3.geometry.partitioning.Embedding, .Hyperplane, .SubHyperplane, .Transform, org.apache.commons.math3.geometry.spherical.oned.Arc, .ArcsSet, .S1Point, .Sphere1D, org.apache.commons.math3.util.FastMath

This class represents an oriented great circle on the 2-sphere.

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.

Since
3.3

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
Circle.CircleTransform

Class embedding a 3D rotation.

Field Summary

Modifier and TypeField and Description
private Vector3D
pole

Pole or circle center.

private final double
tolerance

Tolerance below which close sub-arcs are merged together.

private Vector3D
x

First axis in the equator plane, origin of the phase angles.

private Vector3D
y

Second axis in the equator plane, in quadrature with respect to x.

Constructor Summary

AccessConstructor and Description
public
Circle(final Vector3D
circle pole
pole
,
final double
tolerance below which close sub-arcs are merged together
tolerance
)

Build a great circle from its pole.

public
Circle(final S2Point
first point contained in the great circle
first
,
final S2Point
second point contained in the great circle
second
,
final double
tolerance below which close sub-arcs are merged together
tolerance
)

Build a great circle from two non-aligned points.

private
Circle(final Vector3D
circle pole
pole
,
final Vector3D
first axis in the equator plane
x
,
final Vector3D
second axis in the equator plane
y
,
final double
tolerance below which close sub-arcs are merged together
tolerance
)

Build a circle from its internal components.

public
Circle(final Circle
circle to copy
circle
)

Copy constructor.

Method Summary

Modifier and TypeMethod and Description
public Circle
public Arc

Returns:

arc of the instance that lies inside the other circle
getInsideArc
(final Circle
other circle
other
)

Get the arc of the instance that lies inside the other circle.

public double
getOffset(final Point<Sphere2D>
point to check
point
)

Implements org.apache.commons.math3.geometry.partitioning.Hyperplane.getOffset.

Get the offset (oriented distance) of a point.

public double

Returns:

offset of the direction
getOffset
(final Vector3D
direction to check
direction
)

Get the offset (oriented distance) of a direction.

public double

Returns:

phase angle of the direction around the circle
getPhase
(final Vector3D
direction for which phase is requested
direction
)

Get the phase angle of a direction.

public Vector3D

Returns:

circle point on the sphere
getPointAt
(final double
phase around the circle
alpha
)

Get a circle point from its phase around the circle.

public Vector3D

Returns:

pole of the circle
getPole
()

Get the pole of the circle.

public Circle

Returns:

a new circle, with orientation opposite to the instance orientation
getReverse
()

Get the reverse of the instance.

public double
getTolerance()

Implements org.apache.commons.math3.geometry.partitioning.Hyperplane.getTolerance.

Get the tolerance below which points are considered to belong to the hyperplane.

public static Transform<Sphere2D, Sphere1D>

Returns:

a new transform that can be applied to either Point, Line or SubHyperplane instances
getTransform
(final Rotation
rotation to use
rotation
)

Get a Transform embedding a 3D rotation.

public Vector3D

Returns:

an arbitrary x axis on the circle
getXAxis
()

Get the X axis of the circle.

public Vector3D

Returns:

an arbitrary y axis point on the circle
getYAxis
()

Get the Y axis of the circle.

public Point<Sphere2D>
project(Point<Sphere2D>
point to project
point
)

Implements org.apache.commons.math3.geometry.partitioning.Hyperplane.project.

Project a point to the hyperplane.

public void
reset(final Vector3D
circle pole
newPole
)

Reset the instance as if built from a pole.

public void
revertSelf()

Revert the instance.

public boolean
sameOrientationAs(final Hyperplane<Sphere2D>
other hyperplane to check against the instance
other
)

Implements org.apache.commons.math3.geometry.partitioning.Hyperplane.sameOrientationAs.

Check if the instance has the same orientation as another hyperplane.

public S2Point
toSpace(final Point<Sphere1D>
(n-1)-dimension point of the sub-space
point
)

Implements org.apache.commons.math3.geometry.partitioning.Embedding.toSpace.

Transform a sub-space point into a space point.

public S1Point
toSubSpace(final Point<Sphere2D>
n-dimension point of the space
point
)

Implements org.apache.commons.math3.geometry.partitioning.Embedding.toSubSpace.

Transform a space point into a sub-space point.

public SubCircle
wholeHyperplane()

Implements org.apache.commons.math3.geometry.partitioning.Hyperplane.wholeHyperplane.

Build a sub-hyperplane covering the whole hyperplane.

public SphericalPolygonsSet

Returns:

a region containing the instance (really a SphericalPolygonsSet instance)
wholeSpace
()

Implements org.apache.commons.math3.geometry.partitioning.Hyperplane.wholeSpace.

Build a region covering the whole space.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

poleback to summary
private Vector3D pole

Pole or circle center.

toleranceback to summary
private final double tolerance

Tolerance below which close sub-arcs are merged together.

xback to summary
private Vector3D x

First axis in the equator plane, origin of the phase angles.

yback to summary
private Vector3D y

Second axis in the equator plane, in quadrature with respect to x.

Constructor Detail

Circleback to summary
public Circle(final Vector3D pole, final double tolerance)

Build a great circle from its pole.

The circle is oriented in the trigonometric direction around pole.

Parameters
pole:Vector3D

circle pole

tolerance:double

tolerance below which close sub-arcs are merged together

Circleback to summary
public Circle(final S2Point first, final S2Point second, final double tolerance)

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:S2Point

first point contained in the great circle

second:S2Point

second point contained in the great circle

tolerance:double

tolerance below which close sub-arcs are merged together

Circleback to summary
private Circle(final Vector3D pole, final Vector3D x, final Vector3D y, final double tolerance)

Build a circle from its internal components.

The circle is oriented in the trigonometric direction around center.

Parameters
pole:Vector3D

circle pole

x:Vector3D

first axis in the equator plane

y:Vector3D

second axis in the equator plane

tolerance:double

tolerance below which close sub-arcs are merged together

Circleback to summary
public Circle(final Circle circle)

Copy constructor.

The created instance is completely independent from the original instance, it is a deep copy.

Parameters
circle:Circle

circle to copy

Method Detail

copySelfback to summary
public Circle copySelf()

Implements org.apache.commons.math3.geometry.partitioning.Hyperplane.copySelf.

Doc from org.apache.commons.math3.geometry.partitioning.Hyperplane.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).

Returns:Circle

a new hyperplane, copy of the instance

getInsideArcback to summary
public Arc getInsideArc(final Circle other)

Get the arc of the instance that lies inside the other circle.

Parameters
other:Circle

other circle

Returns:Arc

arc of the instance that lies inside the other circle

getOffsetback to summary
public double getOffset(final Point<Sphere2D> point)

Implements org.apache.commons.math3.geometry.partitioning.Hyperplane.getOffset.

Doc from org.apache.commons.math3.geometry.partitioning.Hyperplane.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.

Parameters
point:Point<Sphere2D>

point to check

Returns:double

offset of the point

See Also
getOffset(Vector3D)
getOffsetback to summary
public double getOffset(final Vector3D direction)

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:Vector3D

direction to check

Returns:double

offset of the direction

See Also
getOffset(Point)
getPhaseback to summary
public double getPhase(final Vector3D direction)

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:Vector3D

direction for which phase is requested

Returns:double

phase angle of the direction around the circle

See Also
toSubSpace(Point)
getPointAtback to summary
public Vector3D getPointAt(final double alpha)

Get a circle point from its phase around the circle.

Parameters
alpha:double

phase around the circle

Returns:Vector3D

circle point on the sphere

See Also
toSpace(Point), getXAxis(), getYAxis()
getPoleback to summary
public Vector3D getPole()

Get the pole of the circle.

As the circle is a great circle, the pole does not belong to it.

Returns:Vector3D

pole of the circle

See Also
getXAxis(), getYAxis()
getReverseback to summary
public Circle 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:Circle

a new circle, with orientation opposite to the instance orientation

getToleranceback to summary
public double getTolerance()

Implements org.apache.commons.math3.geometry.partitioning.Hyperplane.getTolerance.

Doc from org.apache.commons.math3.geometry.partitioning.Hyperplane.getTolerance.

Get the tolerance below which points are considered to belong to the hyperplane.

Returns:double

tolerance below which points are considered to belong to the hyperplane

getTransformback to summary
public static Transform<Sphere2D, Sphere1D> getTransform(final Rotation rotation)

Get a Transform embedding a 3D rotation.

Parameters
rotation:Rotation

rotation to use

Returns:Transform<Sphere2D, Sphere1D>

a new transform that can be applied to either Point, Line or SubHyperplane instances

getXAxisback to summary
public Vector3D 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:Vector3D

an arbitrary x axis on the circle

See Also
getPointAt(double), getYAxis(), getPole()
getYAxisback to summary
public Vector3D 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:Vector3D

an arbitrary y axis point on the circle

See Also
getPointAt(double), getXAxis(), getPole()
projectback to summary
public Point<Sphere2D> project(Point<Sphere2D> point)

Implements org.apache.commons.math3.geometry.partitioning.Hyperplane.project.

Doc from org.apache.commons.math3.geometry.partitioning.Hyperplane.project.

Project a point to the hyperplane.

Parameters
point:Point<Sphere2D>

point to project

Returns:Point<Sphere2D>

projected point

resetback to summary
public void reset(final Vector3D newPole)

Reset the instance as if built from a pole.

The circle is oriented in the trigonometric direction around pole.

Parameters
newPole:Vector3D

circle pole

revertSelfback to summary
public void revertSelf()

Revert the instance.

sameOrientationAsback to summary
public boolean sameOrientationAs(final Hyperplane<Sphere2D> other)

Implements org.apache.commons.math3.geometry.partitioning.Hyperplane.sameOrientationAs.

Doc from org.apache.commons.math3.geometry.partitioning.Hyperplane.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.

Parameters
other:Hyperplane<Sphere2D>

other hyperplane to check against the instance

Returns:boolean

true if the instance and the other hyperplane have the same orientation

toSpaceback to summary
public S2Point toSpace(final Point<Sphere1D> point)

Implements org.apache.commons.math3.geometry.partitioning.Embedding.toSpace.

Doc from org.apache.commons.math3.geometry.partitioning.Embedding.toSpace.

Transform a sub-space point into a space point.

Parameters
point:Point<Sphere1D>

(n-1)-dimension point of the sub-space

Returns:S2Point

n-dimension point of the space corresponding to the specified sub-space point

See Also
getPointAt(double)
toSubSpaceback to summary
public S1Point toSubSpace(final Point<Sphere2D> point)

Implements org.apache.commons.math3.geometry.partitioning.Embedding.toSubSpace.

Doc from org.apache.commons.math3.geometry.partitioning.Embedding.toSubSpace.

Transform a space point into a sub-space point.

Parameters
point:Point<Sphere2D>

n-dimension point of the space

Returns:S1Point

(n-1)-dimension point of the sub-space corresponding to the specified space point

See Also
getPhase(Vector3D)
wholeHyperplaneback to summary
public SubCircle wholeHyperplane()

Implements org.apache.commons.math3.geometry.partitioning.Hyperplane.wholeHyperplane.

Doc from org.apache.commons.math3.geometry.partitioning.Hyperplane.wholeHyperplane.

Build a sub-hyperplane covering the whole hyperplane.

Returns:SubCircle

a sub-hyperplane covering the whole hyperplane

wholeSpaceback to summary
public SphericalPolygonsSet wholeSpace()

Implements org.apache.commons.math3.geometry.partitioning.Hyperplane.wholeSpace.

Build a region covering the whole space.

Returns:SphericalPolygonsSet

a region containing the instance (really a SphericalPolygonsSet instance)

org.apache.commons.math3.geometry.spherical.twod back to summary

private Class Circle.CircleTransform

extends Object
implements Transform<Sphere2D, Sphere1D>
Class Inheritance
  • java.lang.Object
  • org.apache.commons.math3.geometry.spherical.twod.Circle.CircleTransform
All Implemented Interfaces
org.apache.commons.math3.geometry.partitioning.Transform

Class embedding a 3D rotation.

Field Summary

Modifier and TypeField and Description
private final Rotation
rotation

Underlying rotation.

Constructor Summary

AccessConstructor and Description
pack-priv
CircleTransform(final Rotation
rotation to use
rotation
)

Build a transform from a Rotation.

Method Summary

Modifier and TypeMethod and Description
public S2Point
apply(final Point<Sphere2D>
point to transform
point
)

Implements org.apache.commons.math3.geometry.partitioning.Transform.apply.

Transform a point of a space.

public Circle
apply(final Hyperplane<Sphere2D>
hyperplane to transform
hyperplane
)

Implements org.apache.commons.math3.geometry.partitioning.Transform.apply.

Transform an hyperplane of a space.

public SubHyperplane<Sphere1D>
apply(final SubHyperplane<Sphere1D>
sub-hyperplane to transform
sub
,
final Hyperplane<Sphere2D>
hyperplane in which the sub-hyperplane is defined (this is the original hyperplane, the transform has not been applied to it)
original
,
final Hyperplane<Sphere2D>
hyperplane in which the sub-hyperplane is defined (this is the transformed hyperplane, the transform has been applied to it)
transformed
)

Implements org.apache.commons.math3.geometry.partitioning.Transform.apply.

Transform a sub-hyperplane embedded in an hyperplane.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

rotationback to summary
private final Rotation rotation

Underlying rotation.

Constructor Detail

CircleTransformback to summary
pack-priv CircleTransform(final Rotation rotation)

Build a transform from a Rotation.

Parameters
rotation:Rotation

rotation to use

Method Detail

applyback to summary
public S2Point apply(final Point<Sphere2D> point)

Implements org.apache.commons.math3.geometry.partitioning.Transform.apply.

Doc from org.apache.commons.math3.geometry.partitioning.Transform.apply.

Transform a point of a space.

Parameters
point:Point<Sphere2D>

point to transform

Returns:S2Point

a new object representing the transformed point

applyback to summary
public Circle apply(final Hyperplane<Sphere2D> hyperplane)

Implements org.apache.commons.math3.geometry.partitioning.Transform.apply.

Doc from org.apache.commons.math3.geometry.partitioning.Transform.apply.

Transform an hyperplane of a space.

Parameters
hyperplane:Hyperplane<Sphere2D>

hyperplane to transform

Returns:Circle

a new object representing the transformed hyperplane

applyback to summary
public SubHyperplane<Sphere1D> apply(final SubHyperplane<Sphere1D> sub, final Hyperplane<Sphere2D> original, final Hyperplane<Sphere2D> transformed)

Implements org.apache.commons.math3.geometry.partitioning.Transform.apply.

Doc from org.apache.commons.math3.geometry.partitioning.Transform.apply.

Transform a sub-hyperplane embedded in an hyperplane.

Parameters
sub:SubHyperplane<Sphere1D>

sub-hyperplane to transform

original:Hyperplane<Sphere2D>

hyperplane in which the sub-hyperplane is defined (this is the original hyperplane, the transform has not been applied to it)

transformed:Hyperplane<Sphere2D>

hyperplane in which the sub-hyperplane is defined (this is the transformed hyperplane, the transform has been applied to it)

Returns:SubHyperplane<Sphere1D>

a new object representing the transformed sub-hyperplane